Share via


String.startsWith

Class Overview | Class Members | This Package | All Packages

Syntax 1

public boolean startsWith( String prefix**, int** toffset )

Parameters
  • prefix
    the prefix.
  • toffset
    where to begin looking in the string.
Returns

true if the character sequence represented by the argument is a prefix of the substring of this object starting at index toffset; false otherwise.

Description

Tests if this string starts with the specified prefix.

Syntax 2

public boolean startsWith( String prefix )

Parameters
  • prefix
    the prefix.
Returns

true if the character sequence represented by the argument is a prefix of the character sequence represented by this string; false otherwise.

Description

Tests if this string starts with the specified prefix.