'Exploding' a string to an arraylist

  • Thread starter Thread starter Derek Martin
  • Start date Start date
D

Derek Martin

HELP!!!!

I have a string (never mind how it got that way) :-) that looks like this:

Building Operations[]Administrative Services
where [] = chr(10)

(It came from an XML Schema out of an InfoPath Merged Field document, but
that is unimportant at this point)

I need to take that string, and regardless of the number of [], load each
ordinal into it's own index of an arraylist that looks like this:

index|value
-----------
0 | Building Operations
1 | Administrative Services


Can someone show me some code to do that?

Thanks!
Derek
 
Wow, that was fast - and bingo! Just what I needed...now it is time for fun
with loops!
:-)


Russell Jones said:
See the String.Split() method.

Derek Martin said:
HELP!!!!

I have a string (never mind how it got that way) :-) that looks like this:

Building Operations[]Administrative Services
where [] = chr(10)

(It came from an XML Schema out of an InfoPath Merged Field document, but
that is unimportant at this point)

I need to take that string, and regardless of the number of [], load each
ordinal into it's own index of an arraylist that looks like this:

index|value
-----------
0 | Building Operations
1 | Administrative Services


Can someone show me some code to do that?

Thanks!
Derek
 
Back
Top