Wednesday, March 31, 2010

How do I split a string?

public class StringSplit
{
public static void main(String[] args)
{
String data = "1,srirama, java programmer,50000";
String[] items = data.split(",");
for (String item : items)
{
System.out.println("item = " + item);
}
}
}

No comments: