Hi. I'm checking to see if a String contains a sequence of characters. However, I have no clue what to do as CharSequence is an interface. I turned the String into a char array but can't turn that into a CharSequence. What do I do?
Printable View
Hi. I'm checking to see if a String contains a sequence of characters. However, I have no clue what to do as CharSequence is an interface. I turned the String into a char array but can't turn that into a CharSequence. What do I do?
See the API for String...it implements CharSequence so you can pass a String to the String.contains method
the String class has methods to check for strings and substrings. Strings.contains(), String.matches(), etc....