Count all occurrences of a char within a string April 27, 2023 by Tarik "hello".count(_ == 'l') // returns 2