Method in java.lang.String
alter the String.
Some method in java.lang.String returns a new String that is created using the old String.
String substring(int beginIndex): Returns a new string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string. String substring(int beginIndex, int endIndex) Returns a new string that is a substring of this string. The substring begins at the specified "beginIndex" and extends to the character at index "endIndex - 1". "Hello".substring(1) returns "ello" "Hello".substring(0,4) returns "Hell"
String concat(String str): Concatenates the specified string (str) to the end of this string. ...a new String object is created, representing a character sequence that is the concatenation of the character sequence represented by this String object and the character sequence represented by the argument string (str). "Hello".concat("World") returns "HelloWorld"
A "nicer" way to do concat: click here