var input = "12985bwevgjb9812"; string firstDigit = new String(input.TakeWhile(Char.IsDigit).ToArray());