Pergunta de entrevista da empresa Tata Consultancy Services

How to find end of string?