I check if a directory exists with this code:
while (Directory.Exists(currentDirectory + year.ToString)) { // do stuff year++; }
year is a normal integer, currentDirectory is a string. Unfortunately, this operation gives me the "Operator" + "cannot be applied to operands of the type" string "and" group of methods ", a mesage error. I do not want to create a new line for each iteration, when I only need to increase it.
Haris source share