Java Utililty Methods String Trim Left

List of utility methods to do String Trim Left

Description

The list of methods to do String Trim Left are organized into topic(s).

Method

Stringltrim(String list, char[] del)
ltrim
int len = list.length();
char c;
outer: while (len > 0) {
    c = list.charAt(0);
    for (int i = 0; i < del.length; i++) {
        if (c == del[i]) {
            list = list.substring(1);
            len = list.length();
...
Stringltrim(String orig)

Trim the left spacing off of a String.

int len = orig.length();
int st = 0;
int off = 0;
char[] val = orig.toCharArray();
while ((st < len) && (val[off + st] <= ' ')) {
    st++;
return ((st > 0) || (len < orig.length())) ? orig.substring(st, len) : orig;
...
Stringltrim(String pString)
Trims the argument string for whitespace on the left side only.
if ((pString == null) || (pString.length() == 0)) {
    return pString;
for (int i = 0; i < pString.length(); i++) {
    if (!Character.isWhitespace(pString.charAt(i))) {
        if (i == 0) {
            return pString;
        } else {
...
Stringltrim(String s)
ltrim
int len = s.length();
int st = 0;
char[] val = s.toCharArray();
while ((st < len) && (val[st] <= ' ')) {
    st++;
return (st > 0) ? s.substring(st, len) : s;
Stringltrim(String s)
Removes space, carriage, linefeed, and tab chars at the right side of a string.
int index = 0; 
while (index < s.length() && s.charAt(index) == ' ') {
    index++;
return (s.substring(index, s.length()));
Stringltrim(String s)
Trims specified string from left.
if (s == null) {
    return null;
int index = 0;
int len = s.length();
while (index < len && Character.isWhitespace(s.charAt(index))) {
    index++;
return (index >= len) ? "" : s.substring(index);
Stringltrim(String s)
ltrim
StringBuffer buffer = new StringBuffer();
char[] chars = s.toCharArray();
for (int i = 0; i < chars.length; i++) {
    char c = s.charAt(i);
    if (c != ' ') {
        buffer.append(chars, i, chars.length - i);
        break;
return buffer.toString();
Stringltrim(String s)
Trims the space characters from the beginning of a string.
int count = s.length();
int st = 0;
while ((st < count) && isSpace(s.charAt(st))) {
    st++;
return st > 0 ? s.substring(st, count) : s;
StringlTrim(String s)
Elimina gli spazi a sx della stringa
if (s == null) {
    return null;
} else {
    char c[] = s.toCharArray();
    int i = 0;
    while (i < s.length() && c[i] == ' ') {
        i++;
    return s.substring(i, s.length());
Stringltrim(String s)
Trim spaces off the left side of this string.
StringBuffer buf = new StringBuffer(s);
for (int n = 0; n < buf.length() && buf.charAt(n) == ' ';) {
    buf.delete(0, 1);
return buf.toString();