March 16th, 2013, 12:27 PM
Cutting and Splicing Strings
So I'm pretty much a newb with programming and need some help with cutting segments of a string w/ unknown length then replacing that cut section to the remaining string.
Example: [T]urtles --> urtles[T] or [Tur]tles --> tles[Tur]
here is my code I've been trying to accomplish the above task with
String sFirst = first.substring(1,(first.lastIndexOf(' ')));
String sFirst = first.substring(first.lastIndexOf(' ')+1);
any ideas what I could be doing wrong?
March 16th, 2013, 01:39 PM
Why are you looking for the location of ' '?