Added the getCharCount function

This function is used to calculate the number of characters in given string