find the occurences of a character in a string