I am new to Java reg expressions, but this looks like a good case to use them. I am getting a string that sometimes has multiple values seperated by commas. So For example I might get "Value1, Value2, Value3". Or it might just conatain one value with no commas. Like "Value1". It looks like the String class has a methods that takes a regex and the string and returns a String. So I am wondering if it is just one value will it return that one? Does anyone have an example?
I am assuming that you mean the split() method? Yes, if you provide a delimiter that doesn't exist, and the original string is not zero length, it will return an array of size one, with the original value.