Java Utililty Methods String Start With

List of utility methods to do String Start With

Description

The list of methods to do String Start With are organized into topic(s).

Method

StringstartWithLowerCase(String methodName)
start With Lower Case
if (methodName.length() > 1 && Character.isUpperCase(methodName.charAt(1)))
    return methodName;
char firstChar = Character.toLowerCase(methodName.charAt(0));
return firstChar + methodName.substring(1);
booleanstartWithProtocol(String input)
Checks if the given string matches some of the protocols suported by this method.
boolean ret = false;
if (input != null) {
    input = input.toLowerCase();
    for (int i = 0; i < protocols.length; i++) {
        if (input.startsWith(protocols[i])) {
            ret = true;
            break;
return ret;
booleanstartWithProtocol(String input)
Check if the provided String start with one supported protocol strings.
if (input != null) {
    input = input.toLowerCase();
    for (String protocol : PROTOCOLS) {
        if (input.startsWith(protocol)) {
            return true;
return false;
booleanstartWithRoot(String path)
Checks if the provide path starts with a valid root, such as "/" or "C:".
return startsWithLinuxRoot(path) || startWithWindowsRoot(path);
StringstartWithUppercase(String name)
start With Uppercase
if (name == null)
    throw new NullPointerException();
if (name.isEmpty())
    return name;
return name.substring(0, 1).toUpperCase() + name.substring(1);
StringstartWithUppercase(String text)
start With Uppercase
if (text.length() > 2) {
    return Character.toUpperCase(text.charAt(0)) + text.substring(1);
} else {
    return text;
booleanstartWithWindowsRoot(String path)
Checks if the provide path starts with a valid Windows root, for example "C:".
return path != null && path.length() >= 2 && path.charAt(1) == ':' && Character.isLetter(path.charAt(0));