次のような while ループを作成するにはどうすればよいでしょうか (疑似コード)。
While the index of "blahblah" in string 1 exists
do this
次のような while ループを作成するにはどうすればよいでしょうか (疑似コード)。
While the index of "blahblah" in string 1 exists
do this
while(string1.Contains("blahblah")) {
// do this
}
C# に正常にコンパイルされた疑似コード。0 エラー、0 警告。かかった時間: 0:00:01.860。
var string1 = "blahblah blahblah blahblah blahblah ";
int pos = -1;
while (0 >= (pos = string1.IndexOf("blahblah", pos + 1)))
{
// do this.
}