import java.util.ArrayList;
import java.util.List;
public class Participle
{
private static final String HEAD_END_STR = "_";
private static final int PARTICIPLE_LENGTH = 2;
public static void main(String[] args)
{
String exampleWord = "計算機";
exampleWord = "_" + exampleWord + "_";
int length = exampleWord.length();
List<String> result = new ArrayList<String>();
for (int i = 0; i < length - 1; i++)
{
String str = exampleWord.substring(i, i + PARTICIPLE_LENGTH);
result.add(str);
}
System.out.println(result);
}
}
輸出結果:_計, 計算, 算機, 機_