|
|
2行目: |
2行目: |
| public String substring(int beginIndex, int endIndex) | | public String substring(int beginIndex, int endIndex) |
|
| |
|
| この文字列の部分文字列である文字列を返します。部分文字列は、指定されたbeginIndexから始まり、インデックスendIndex - 1にある文字までです。
| | 指定の数だけ文字を取り出します。 |
|
| |
|
| int num = Integer.parseInt(input);
| | String s1 = "Java and Python and C++."; |
| String str = text.substring(num); | | System.out.println(s1.substring(0,6)); |
| System.out.println(str); | |
2019年6月9日 (日) 13:30時点における版
"String".substring [1]
public String substring(int beginIndex, int endIndex)
指定の数だけ文字を取り出します。
String s1 = "Java and Python and C++.";
System.out.println(s1.substring(0,6));