Split stringbuilder in array

  • Thread starter Thread starter Arjen
  • Start date Start date
A

Arjen

Hi,

How can I split a stringbuilder into arrays?

Let's say I have a stringbuilder with this value "test1234567".
Now I want an array with size 6. The value of the array have to be on index
0 "234567" and on index 1 "test1".

How can I do this?

Thanks!
 
Arjen said:
How can I split a stringbuilder into arrays?

Let's say I have a stringbuilder with this value "test1234567".
Now I want an array with size 6. The value of the array have to be on index
0 "234567" and on index 1 "test1".

What's meant to determine where the string is split? I suggest you call
ToString and then Substring...
 
You could loop thru each character in the Stringbuilder and fill each array
based on the current index in the loop.

Or you could call .ToString() on the stringbuilder and use the IndexOf or
Substring or whatever String functions you needed.
 
You can't split a Stringubilder. You CAN split the string it builds. The
string it builds can easily be obtained by calling ToString() on the
StringBuilder. Then you can chop it up anyway you like.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
Back
Top