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(String receiver, String... needles)
starts With
return startsWith(receiver, false, needles);
booleanstartsWith(String s, boolean caseIgnore, String... args)
starts With
if (s == null) {
    return false;
for (String arg : args) {
    if (caseIgnore) {
        s = s.toLowerCase();
        arg = arg.toLowerCase();
    if (s.startsWith(arg)) {
        return true;
return false;
booleanstartsWith(String s, char begin)
starts With
return startsWith(s, Character.toString(begin));
booleanstartsWith(String s, char c)
An efficient method for checking if a string starts with a character.
if (s != null) {
    int i = s.length();
    if (i > 0)
        return s.charAt(0) == c;
return false;
booleanstartsWith(String s, int offset, int end, String t)
True iff s[off:end] starts with t.
int n = t.length();
if (end - offset < n) {
    return false;
int off = offset;
for (int i = 0; i < n; ++off, ++i) {
    if (s.charAt(off) != t.charAt(i)) {
        return false;
...
booleanstartsWith(String s, String begin)
starts With
if ((s == null) || (begin == null)) {
    return false;
if (begin.length() > s.length()) {
    return false;
String temp = s.substring(0, begin.length());
if (temp.equalsIgnoreCase(begin)) {
...
booleanstartsWith(String s, String prefix)
starts With
return s.toLowerCase().startsWith(prefix.toLowerCase());
booleanstartsWith(String s, String prefix)
starts With
if (s == null) {
    return false;
for (int i = 0; i < s.length(); i++) {
    if (Character.isWhitespace(s.charAt(i))) {
        continue;
    } else {
        return s.regionMatches(i, prefix, 0, prefix.length());
...
booleanstartswith(String s, String prefix)
This function performs a case-insensitive starts-with test.
if (s == null || prefix == null) {
    return false;
return s.toLowerCase().startsWith(prefix.toLowerCase());
booleanstartsWith(String s, String start)
Check is a string starts with another string, ignoring the case.
return s == null || start == null ? false : s.startsWith(start);