Java String startsWith() method

Facebooktwitterredditpinterestlinkedinmailby feather

Java String startsWith() method checks whether current String starts with given prefix or not .

Syntax:

Parameters:

prefix : It is sequence of character

Returns:

It returns true, if this string starts with given prefix else returns false.

Java String startsWith() method example 1

Output:

Java String startsWith(String prefix, int offset) Method Example 2

Output

Java String startsWith() method example 3 

Output:

Java String startsWith() method example 4

Output:

Java String startsWith() method example 5

Output:

Facebooktwitterredditpinterestlinkedinmailby feather

Leave a Comment