String Split ?

How to split string for this data on java programming

String sdata[] ={"Code:id:100","Name:nm:200","Address:add:300"};

i want to split with delimiter ":" and ","

can anybody give me the sample code for this my problem ?

thanks

Message was edited by:

panji_tengkorak

null

[448 byte] By [panji_tengkoraka] at [2007-11-27 4:03:12]
# 1
You have an array of three String. Can you better explain what you want. Do you want to split all three Strings? How do you want to split them?
floundera at 2007-7-12 9:07:58 > top of Java-index,Java Essentials,New To Java...
# 2
yes i want to split all data.on my post i have three array.i want to display data like this.array 1:Desciption : .....Tag : ....Width : ...array 2:.............. etcMessage was edited by: panji_tengkorak
panji_tengkoraka at 2007-7-12 9:07:58 > top of Java-index,Java Essentials,New To Java...
# 3
So you want to split on the colon. Then you need to pass a colon as the parameter to the split method.
floundera at 2007-7-12 9:07:58 > top of Java-index,Java Essentials,New To Java...
# 4

OK. i will repeat my question.

my string variable like this :

String sdata[] = {"YUSUF HERMANTO;MALE;INDONESIA"};

and i want to display data like this :

Name : YUSUF HERMANTO

SEX: MALE

COUNTRY : INDONESIA

panji_tengkoraka at 2007-7-12 9:07:58 > top of Java-index,Java Essentials,New To Java...
# 5

> So you want to split on the colon. Then you need to

> pass a colon as the parameter to the split method.

This was referring to the method String.split(). The question is already answered :)

editing to add a link:

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#split(java.lang.String)

bheilersa at 2007-7-12 9:07:58 > top of Java-index,Java Essentials,New To Java...
# 6
And I will repeat my answer: "Then you need to pass a colon as the parameter to the split method." Although the parameter now need to be a semicolon.
floundera at 2007-7-12 9:07:58 > top of Java-index,Java Essentials,New To Java...
# 7
thanks
panji_tengkoraka at 2007-7-12 9:07:58 > top of Java-index,Java Essentials,New To Java...