How do I get the content after the last comma in a string using a regular expression?
Example:
abcd,fg;ijkl, cas
The output should
Perhaps something like:
String s = "abcd,fg;ijkl, cas"; String result = s.substring(s.lastIndexOf(',') + 1).trim();
That is, I take the substring occurring after the last comma and remove surrounding white space afterwards...