PG
public static final int array[][] =
{
{0,4},
{4,9},
{9,12},
{12,15}
};
public void test3() {
String mojiretsu = "12あ41 345 23111";
String conv = "";
for(int i = 0; i<array.length; i++){
int mae = 0;
int ushiro = 0;
for(int j = 0; j<array[i].length; j++){
if(j == 0) {
mae = array[i][j];
}else {
ushiro = array[i][j];
}
}
System.out.println(mojiretsu.substring(mae, ushiro));
}
}
結果
12あ4
1 345
23
111