Last active
November 4, 2019 07:21
-
-
Save libliboom/3721b896a530bcb7a3f0575b9db2eb2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String substring(int beginIndex) { | |
if (beginIndex < 0) { | |
throw new StringIndexOutOfBoundsException(beginIndex); | |
} | |
int subLen = value.length - beginIndex; | |
if (subLen < 0) { | |
throw new StringIndexOutOfBoundsException(subLen); | |
} | |
return (beginIndex == 0) ? this : new String(value, beginIndex, subLen); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment