Counting how many times a certain char appears in a string before any other char appears April 14, 2023 by Tarik You could use the Count method var count = mystring.Count(x => x == '$')