// Enumerable.Range gives you 1,2,3,...Char.Length foreach(int CharLength in Enumerable.Range(1, Char.Length)) or // this sets CharLength to 0, 1, 2, ... CharLength-1 for(int CharLength = 0; CharLength < Char.Length; CharLength++)