String startsWith(String prefix) method in Java

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

Syntax

Let us see the syntax,

Parameters

Let us see the parameters,

  • prefix − prefix to be matched

Example

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

Output

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
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