-
Notifications
You must be signed in to change notification settings - Fork 1
left
Subhajit Sahu edited this page May 5, 2020
·
1 revision
Return leftmost part of string.
var left = require('@extra-string/left');
// left(<string>, <length>)
left('Thai Sweet Chilli Sauce', 4); // 'Thai'
left('Thai Sweet Chilli Sauce', 10); // 'Thai Sweet'
left('Thai Sweet Chilli Sauce', 80); // 'Thai Sweet Chilli Sauce'
left('Thai Sweet Chilli Sauce', -1); // ''