-
Which of these methods of class String is used to check whether a given object starts with a particular string literal?
-
- ends()
- startsWith()
- endsWith()
- Starts()
- None of these
Correct Option: B
Method startsWith() of string class is used to check whether the String in question starts with a specified string. It is a specialized form of method regionMatches().