Created
March 23, 2015 08:54
-
-
Save ron623/9e433f398f981d2c12f1 to your computer and use it in GitHub Desktop.
substring
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
/** | |
*この文字列の部分文字列である新しい文字列を返します。部分文字列は、指定された beginIndex から始まり、 | |
*インデックス endIndex - 1 にある文字までです。したがって、部分文字列の長さは endIndex-beginIndex になります。 | |
*/ | |
public String substring(int beginIndex, int endIndex) { | |
return ((beginIndex == 0) && (endIndex == count)) ? this : | |
new String(offset + beginIndex, endIndex - beginIndex, value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment