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 s, String start)
Returns true if, ignoring case, the string starts with the specified start string.
if ((s == null) || (start == null)) {
    return false;
if (start.length() > s.length()) {
    return false;
String temp = s.substring(0, start.length());
if (temp.equalsIgnoreCase(start)) {
...
booleanstartsWith(String s1, String s2)
starts With
if (s1 == null) {
    if (s2 == null) {
        return true;
    } else {
        return false;
} else {
    if (s2 == null) {
...
BooleanstartsWith(String self, String pattern)
starts With
return startsWith(self, pattern, 0);
booleanstartsWith(String source, String target, boolean caseSensitive)
starts With
boolean result = false;
if (!isEmpty(source) && !isEmpty(target) && source.length() >= target.length()) {
    if (caseSensitive) {
        result = target.equals(source.substring(0, target.length()));
    } else {
        result = target.equalsIgnoreCase(source.substring(0, target.length()));
return result;
booleanstartsWith(String str, char c)
starts With
return str.length() > 0 && str.charAt(0) == c;
booleanstartsWith(String str, char prefix)
Tests if this string starts with the specified prefix.
return str != null && str.length() > 0 && str.charAt(0) == prefix;
booleanstartsWith(String str, char prefix)
starts With
if (str == null || str.isEmpty())
    return false;
return (str.charAt(0) == prefix);
booleanstartsWith(String str, String mark, int paramInt)
starts With
char[] value = str.toCharArray();
if ((paramInt < 0) || paramInt > value.length) {
    return false;
int k = mark.length();
char[] chars = mark.toCharArray();
while (--k >= 0) {
    if (value[paramInt + k] != chars[k]) {
...
booleanstartsWith(String str, String prefix)
starts With
return str != null && str.startsWith(prefix);
booleanstartsWith(String str, String prefix)
Tests if the provided string starts with the specified prefix.
Comparison is case-sensitive.
if (str != null && prefix != null) {
    return str.startsWith(prefix);
return (str == null && prefix == null);