Search code examples
stringsplitexplode

split every single character in string. VBA.net


can you help me on this?

I have a simple string:

str="Hello World";

I want to split it as that :

array= str.Split("",System.StringSplitOptions.RemoveEmptyEntries);

result shoud be

array[0]="H"
array[1]="e"
array[2]="l"
array[3]="l"
array[4]="o"
array[5]="W"
array[6]="o"
...

But I don't know to "wildcard" the separator..

Any Idea on this ? Thanks


Solution

  • ?

    Just use String.ToCharArray():

    SomeArray = str.ToCharArray()