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

booleanstartsWithAny(String text, String... prefixes)
Return whether the non-null text arg starts with any of the prefix values.
for (String prefix : prefixes) {
    if (text.startsWith(prefix)) {
        return true;
return false;
booleanstartsWithAny(String toMatch, String... startsWithAny)
Checks if a given String starts with any of the given Strings
for (String s : startsWithAny) {
    return toMatch.startsWith(s);
return false;
booleanstartsWithAnyCI(String string, String... prefixes)
starts With Any CI
string = string.toLowerCase();
for (String prefix : prefixes)
    if (string.startsWith(prefix.toLowerCase()))
        return true;
return false;
booleanstartsWithAnyCS(String str, String[] needles)
starts With Any CS
if (str == null || str.length() == 0)
    return false;
for (String n : needles) {
    if (str.startsWith(n))
        return true;
return false;
booleanstartsWithAnyIgnoreCase(String s, String... options)
Checks whether the given String starts with any of the given options, ignoring the case
if (s == null) {
    return false;
for (String element : options) {
    if (s.toLowerCase().startsWith(element.toLowerCase())) {
        return true;
return false;
booleanstartsWithAnyIgnoreCase(String string, String... searchStrings)
starts With Any Ignore Case
for (int i = 0; i < searchStrings.length; i++) {
    String searchString = searchStrings[i];
    if (startsWithIgnoreCase(string, searchString)) {
        return true;
return false;
booleanstartsWithAnyOfThose(final String in, final String[] prefixes)
starts With Any Of Those
for (final String prefix : prefixes) {
    if (in.startsWith(prefix)) {
        return true;
return false;
booleanstartsWithAt(String text, String toFind, int offset)
starts With At
for (int i = 0; i < toFind.length(); i++) {
    if (offset + i >= text.length() || text.charAt(offset + i) != toFind.charAt(i)) {
        return false;
return true;
booleanstartsWithCamelCase(String string, String prefix)
starts With Camel Case
return string.length() > prefix.length() && string.startsWith(prefix)
        && Character.isUpperCase(string.charAt(prefix.length()));
booleanstartsWithCapLettersEndsWithDigits(String text)
Determine if a string starts with capital letter(s) and ends with digit(s).
boolean result = false;
if (!isNullOrEmpty(text, true)) {
    char[] cs = text.toCharArray();
    int j = 0;
    while ((j < cs.length) && (Character.isUpperCase(cs[j]))) {
        j++;
    if ((j == 0) || (j == cs.length)) {
...