Finding # occurrences of a character in a string in Ruby December 30, 2022 by Tarik If you just want the number of a’s: puts "Melanie is a noob".count('a') #=> 2 Docs for more details.