Gnani.ai Interview Question

How to count the characters in a string?