Yeah. I know... I suck and I should 'learn how to google'...
I need help edit strings.
I have a string that is lastname,firstname
What command is used to delete everything up to the comma?
How do I delete everything before the comma?
All suggestions welcome..
kubie
AG - 07 Mar 2006 23:17 GMT
String name = "firstName,LastName";
name = name.substring(name.indexOf(',')+1, name.length()));
> Yeah. I know... I suck and I should 'learn how to google'...
> I need help edit strings.
[quoted text clipped - 7 lines]
>
> kubie
mike - 07 Mar 2006 23:17 GMT
I would do:
String newString = oldString.substring(oldString.indexOf(','));
There might be a better way, but that will return a new string of
everything up to and not including the ','
mike - 07 Mar 2006 23:19 GMT
yeah. oldString.indexOf(',')+1
My bad.