There is a function of the form:
string MyFunc(string input) { for (int i = 0; i < input.Lenght; i++) { //разнообразные вычисления, например такие: input = input.Replace("bla", "bla1"); //а здесь рекурсивный вызов: input = MyFunc(input); } }
Inside, the output for the chapels line. That is, in the condition:
if (input[i] == 'b')
Actually the question is: For a for loop, is the i <input.Lenght entry evaluated once? It turns out that the input line is reduced, and (i <input.Lenght) remains const? And how to avoid it right away?