How would I split a string at a particular index? e.g split string at index 10, making the string now equal to everything up to index 10 and then dumping the remainder.
this works too
String myString = "a long sentence that repeats itself = 1 and = 2 and = 3 again"
String removeFromThisPart = " and"
myString = myString .substring(0, myString .lastIndexOf( removeFromThisPart ));
System.out.println(myString);
the result should be
a long sentence that repeats itself = 1 and = 2