static int FindFirstUpperCharacter(string name) { for (var i = 0; i < name.Length; i++) { if (Char.IsUpper(name[i])) return i; } return 0; }