syntax of Starts with/Ends with in java
Answers
Answered by
0
Answer:
The startsWith() method of String class is used for checking prefix of a String. It returns a boolean value true or false based on whether the given string begins with the specified letter or word.
For example:
String str = "Hello";
//This will return true because string str starts with "He"
- str.startsWith("He");
Similar questions