simple string extraction in java

hello,

i want to extract text from a string as shown below:

*****************************

String inputStr = "some text , some text, some text ";

String[ ] splitStr = inputStr.split(",");

out.println(splitStr[2]);

************************

therefore as u saw the string is seperated by commas

BUT sometimes thereis no need to split because

the string can also be a single parameter like this:

"some string"

thus hw can i check if it is a single string (is some numbers)

then just pass that as a parameter but

if not then do split......

can u plz help urgent,

moh

[657 byte] By [moh_1_and_onlya] at [2007-11-26 19:48:53]
# 1
Stop crossposting! http://forum.java.sun.com/thread.jspa?threadID=5141732&messageID=9522308#9522308
PhHeina at 2007-7-9 22:36:53 > top of Java-index,Java Essentials,New To Java...