UNPKG

better-substring

Version:

Improved substring method to avoid splitting mid word

3 lines (2 loc) 459 B
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e||self).betterSubstring=n()}(this,function(){function e(e){return e>47&&e<58||e>64&&e<91||e>96&&e<123}return function(n,f,o,i,t){if(void 0===o&&(o=!1),void 0===t&&(t=!0),f>0)for(;e(n.charCodeAt(f));)o?f++:f--;if(i)for(;e(n.charCodeAt(i));)t?i++:i--;return n.substring(f,i).trim()}}); //# sourceMappingURL=index.umd.js.map