java tutorial - Java Strings startsWith() method - java programming - learn java - java basics - java for beginners
Learn Java - Java tutorial - Java strings startswith - Java examples - Java programs
Description
The method startsWith () has two options and checks whether the string starts with the specified prefix, starting at the specified index or from the beginning (by default).
Syntax
Syntax method:
Options
Detailed information about the parameters:
- prefix — the prefix to be matched;
- toffset is the initial search index in the string.
Return value
- In Java, startsWith () method returns true if the sequence of characters represented by the argument is the prefix of the sequence of characters represented by the given string; or else false.