function trim(haystack, needle) {
    if (needle === void 0) { needle = ' '; }
    var trimmed = ltrim(haystack, needle);
    return rtrim(trimmed, needle);
}
/**
 * Removes all occurrences of needle from the beginning and end of haystack.
 * @param haystack string to trim
 * @param needle the thing to trim (default is a blank)
 */
Removes all occurrences of needle from the beginning and end of haystack.
@param haystack string to trim
@param needle the thing to trim (default is a blank)
Removes all occurrences of needle from the beginning and end of haystack . @param haystack string to trim @param needle the thing to trim ( default is a blank )
function trim(haystack, needle) {
    if (needle === void 0) { needle = ' '; }
    var trimmed = ltrim(haystack, needle);
    return rtrim(trimmed, needle);
}
function trim ( haystack , needle ) { if ( needle === void 0 ) { needle = ' ' ; } var trimmed = ltrim ( haystack , needle ) ; return rtrim ( trimmed , needle ) ; }
Removes all occurrences of needle from the beginning and end of haystack.
Removes all occurrences of needle from the beginning and end of haystack .