Interception string, java language usage
1、 public String substring(int beginIndex)
Returns a new string that is a substring of this string. The substring begins at the specified character index, it has been the end of this string.
Parameters: beginIndex - the index at the beginning of (including),
Returns: the specified sub- string,
Exception: If beginIndex is negative or greater than the length of the String object, then throws IndexOutOfBoundsException
例 :"unhappy".substring(2) returns"happy"
"mybaby".substring(3) returns"aby"
2、public String substring(int beginIndex, int endIndex)
Returns a new string that is a substring of this string. The sub- string starting at the specified beginIndex, endIndex: endIndex 1-at the specified end.
Parameters: beginIndex - the index at the beginning of (including)