Java String substring() method returns the substring of this string. This method always returns a new string and the original string remains unchanged because String is immutable in Java.
Java String substring()方法返回此字符串的子字符串。 此方法始终返回一个新字符串,而原始字符串则保持不变,因为String在Java中是不可变的 。
Java String substring()方法 (Java String substring() Methods)
Java String substring method is overloaded and has two variants.
Java String子字符串方法已重载,并且具有两个变体。
substring(int beginIndex)
: This method returns a new string that is a substring of this string. The substring begins with the character at the specified