parse a string to an array

I

Ike

If I have a String such that

String mystring = "{{0,0,0},{1,1,1},{2,2,2}}";

and from that, I want to create

String mynewstring [] [] = .......how would you parse out mystring into
mynewstring [] [] given that mystring is a variable ?

-Ike
 
S

sks

Ike said:
If I have a String such that

String mystring = "{{0,0,0},{1,1,1},{2,2,2}}";

and from that, I want to create

String mynewstring [] [] = .......how would you parse out mystring into
mynewstring [] [] given that mystring is a variable ?

Take a look at the split(String) method in String.
 
L

Liz

sks said:
Ike said:
If I have a String such that

String mystring = "{{0,0,0},{1,1,1},{2,2,2}}";

and from that, I want to create

String mynewstring [] [] = .......how would you parse out mystring into
mynewstring [] [] given that mystring is a variable ?

Take a look at the split(String) method in String.
If this is the pattern it looks like you can convert "}," to ";"
then get rid of the remaining "}" and "{" then split on ";"
then split on ","
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top