Welcome to the forum! Please read this topic to learn how to post code correctly.

Review the String API for possible answers to your question.