Article From:

You can select some library functions for not only the operation of a single character but the operation of the word.


Commonly used are:

1. str.split(” “);  Divide the string according to the space and get the string array.

2. str.substring(i, j); Get string’s substring [I, J]

3. str.contains(“s1”); strWhether or not a S1 string is included in it

4. str.charAt(7); strThe char type character on the 7 position

5. str.trim(); Remove the space on both sides of the str

Application: goat Latin Goat Latin

*LeetCode–Goat Latin

Leave a Reply

Your email address will not be published. Required fields are marked *