How to use the rtrim function from underscore.string

Find comprehensive JavaScript underscore.string.rtrim code examples handpicked from public code repositorys.

261
262
263
264
265
266
267
268
269
270
271
272
};


function normalizePath(path) {
    path = _string.ltrim(path, './');
    path = _string.ltrim(path, '/');
    path = _string.rtrim(path, '/');


    return path;
}

fork icon18
star icon8
watch icon0

+ 2 other calls in file

977
978
979
980
981
982
983
984
985
986
987
s.map              = require('./map');


// Aliases
s.strip     = s.trim;
s.lstrip    = s.ltrim;
s.rstrip    = s.rtrim;
s.center    = s.lrpad;
s.rjust     = s.lpad;
s.ljust     = s.rpad;
s.contains  = s.include;
fork icon0
star icon6
watch icon0

73
74
75
76
77
78
79
80
81
82
83
84
exports.ltrim = function(value, options, callback){
    callback(null, str.ltrim(String(value), typeof options[0] === 'string' ? options[0] : undefined));
};


exports.rtrim = function(value, options, callback){
    callback(null, str.rtrim(String(value), typeof options[0] === 'string' ? options[0] : undefined));
};


exports.truncate = function(value, options, callback){
    callback(null, str.truncate(String(value), options[0], typeof options[1] === 'string' ? options[1] : undefined));
fork icon2
star icon2
watch icon0

+ 2 other calls in file