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