I'm curious, how would you test a string and say "yep, that is a comma delimited list!" I'm not so worried about the 'comma delimited' part more that this string has more than one item in it?
Thanks, R.
How about:
stringObject.indexOf(",") >= 0
To check if the string has more than one item, try something like:
str.split(",").length > 1
... although, as suggested in a comment, correct parsing is likely to be bit more complicated than this for the general case.
whoops, misread language as Java - sorry.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With