Created
April 2, 2015 05:06
-
-
Save Togami-Arahi/029c89f1dcb6dffe0a50 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
// http://www.javadrive.jp/start/string/index5.htmlからコピペ | |
class CharAt{ //JSample5_1をCharAtに改変 | |
public static void main(String args[]){ | |
String str = "パタトクカシーー"; //腕時計をパタトクカシーーに改変 | |
char c1 = str.charAt(0); | |
char c3 = str.charAt(2); | |
char c5 = str.charAt(4); | |
char c7 = str.charAt(6); //一つ追加 | |
// http://www.techscore.com/blog/2012/11/29/%E6%96%87%E5%AD%97%E5%88%97%E7%B5%90%E5%90%88-java%E7%B7%A8/からコピペ改変 | |
StringBuilder buf = new StringBuilder(); | |
buf.append(c1); | |
buf.append(c3); | |
buf.append(c5); | |
buf.append(c7); | |
String c = buf.toString(); | |
System.out.println(c); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment