function ltrim(haystack, needle) {
    if (!haystack || !needle) {
        return haystack;
    }
    var needleLen = needle.length;
    if (needleLen === 0 || haystack.length === 0) {
        return haystack;
    }
    var offset = 0;
    while (haystack.indexOf(needle, offset) === offset) {
        offset = offset + needleLen;
    }
    return haystack.substring(offset);
}
/**
 * Removes all occurrences of needle from the beginning of haystack.
 * @param haystack string to trim
 * @param needle the thing to trim
 */
Removes all occurrences of needle from the beginning of haystack.
@param haystack string to trim
@param needle the thing to trim
Removes all occurrences of needle from the beginning of haystack . @param haystack string to trim @param needle the thing to trim
function ltrim(haystack, needle) {
    if (!haystack || !needle) {
        return haystack;
    }
    var needleLen = needle.length;
    if (needleLen === 0 || haystack.length === 0) {
        return haystack;
    }
    var offset = 0;
    while (haystack.indexOf(needle, offset) === offset) {
        offset = offset + needleLen;
    }
    return haystack.substring(offset);
}
function ltrim ( haystack , needle ) { if ( ! haystack || ! needle ) { return haystack ; } var needleLen = needle . length ; if ( needleLen === 0 || haystack . length === 0 ) { return haystack ; } var offset = 0 ; while ( haystack . indexOf ( needle , offset ) === offset ) { offset = offset + needleLen ; } return haystack . substring ( offset ) ; }
Removes all occurrences of needle from the beginning of haystack.
Removes all occurrences of needle from the beginning of haystack .