アプリケーションの文字列の「無限」リストを作成したいと思います。これを使ってみた……。
public static void runinfinite(int length) {
String lastString= " ";
while (true) {
if (lastString.length() > length)
break;
lastString = lastString.trim();
for (char c0 = 'a'; c0 <= 'z'; c0++) {
lastString += c0;
action(lastString);
}
}
}
それは私にこれだけを与えます: abcdefghijklmnopqrstuvwxyz
. 文字列を「無限に」作成するコードのブロックを持っている人はいますか?
編集:この例のような文字列のリストを作成するために必要です:[同じ順序である必要はなく、文字列の束だけです]
編集 2:この例をより適切に機能させ、永久に実行したいと考えています。