Gnani.ai interview question

How to count the characters in a string?