Java Utililty Methods String Starts Wtih

List of utility methods to do String Starts Wtih

Description

The list of methods to do String Starts Wtih are organized into topic(s).

Method

booleanstartsWith(CharSequence cs, CharSequence prefix, boolean caseSensitive)
Tests if a char sequence starts with some prefix
return startsWith(cs, prefix, 0, caseSensitive);
booleanstartsWith(CharSequence input, String prefix)
starts With
if (input.length() < prefix.length()) {
    return false;
if (input.getClass() == String.class) {
    return ((String) input).startsWith(prefix);
int len = prefix.length();
for (int i = 0; i < len; i++) {
...
booleanstartsWith(CharSequence s, CharSequence seq)
Behaves like String.startsWith but for CharSequence.
return regionMatches(false, s, 0, seq, 0, seq.length());
booleanstartsWith(CharSequence seq, char... any)
starts With
if (seq.length() > 0) {
    for (int i = 0; i < any.length; i++) {
        if (seq.charAt(0) == any[i])
            return true;
return false;
booleanstartsWith(CharSequence seq, String str)
Implementation of String.startsWith() for CharSequence.
boolean ret = true;
for (int i = 0; i < str.length(); i++) {
    if (i >= seq.length() || seq.charAt(i) != str.charAt(i)) {
        ret = false;
        break;
return ret;
...
booleanstartsWith(CharSequence source, CharSequence search)
Returns true if the source sequence starts with the search sequence.
return containsAt(source, search, 0);
booleanstartsWith(CharSequence str, char prefix)
starts With
if (str == null) {
    return false;
if (str.length() < 1) {
    return false;
char firstCh = str.charAt(0);
return (firstCh == prefix);
...
booleanstartsWith(CharSequence str, CharSequence prefix)
Return true if one CharSequence starts with the other.
return startsWith(str, prefix, 0);
booleanstartsWith(final boolean caseSensitive, final char[] text, final char[] prefix)

Checks whether a text starts with a specified prefix.

return startsWith(caseSensitive, text, 0, text.length, prefix, 0, prefix.length);
booleanstartsWith(final CharSequence str, final CharSequence prefix)
starts With
return startsWith(str, 0, str.length(), prefix);