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
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
> 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)