String startsWith(String prefix) method in Java

The startsWith(String prefix) method in Java tests if this string starts with the specified prefix.


Let us see the syntax,


Let us see the parameters,

  • prefix − prefix to be matched


The following is an example of boolean startsWith(String prefix),


The following is the output,

Java string startswith method

String split(String regex, int limit) method in Java
String startsWith(String prefix, int toffset) method in Java
Studyopedia Editorial Staff
[email protected]

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading