Created
April 9, 2014 12:37
-
-
Save skrb/10264845 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 stringArrayJoining() { | |
char[] dest = new char[18000]; | |
dest[0]= '['; | |
int destOffset = 1; | |
for (int i = 0; i < strarray.length; ++i) { | |
if (i != 0) { | |
dest[destOffset] = ']'; | |
destOffset++; | |
dest[destOffset] = ','; | |
destOffset++; | |
dest[destOffset] = '['; | |
destOffset++; | |
} | |
strarray[i].getChars(0, strarray[i].length(), dest, destOffset); | |
destOffset += strarray[i].length(); | |
} | |
dest[destOffset] = ']'; | |
destOffset++; | |
return new String(dest, 0, destOffset); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment