{"_id":"underscore.string.fp","_rev":"472574","name":"underscore.string.fp","description":"This is a wrapper for underscore.string to use it as a FP-library or with a library like lodash-fp or ramda","dist-tags":{"latest":"1.0.4"},"maintainers":[{"name":"schtoeffel","email":""}],"time":{"modified":"2021-08-05T08:24:28.000Z","created":"2015-02-04T09:24:04.965Z","1.0.4":"2015-04-07T15:28:23.828Z","1.0.3":"2015-02-04T21:06:44.334Z","1.0.2":"2015-02-04T20:58:57.450Z","1.0.1":"2015-02-04T13:54:16.188Z","1.0.0":"2015-02-04T09:24:04.965Z"},"users":{"schtoeffel":true},"repository":{"type":"git","url":"https://github.com/stoeffel/underscore.string.fp.git"},"versions":{"1.0.4":{"name":"underscore.string.fp","version":"1.0.4","description":"This is a wrapper for underscore.string to use it as a FP-library or with a library like lodash-fp or ramda","homepage":"http://github.com/stoeffel/underscore.string.fp/","contributors":[{"name":"Christoph Hermannd","email":"schtoeffel@gmail.com","url":"<http://schtoeffel.ch>"}],"keywords":["ramda","string","underscore.string"],"main":"./index.js","directories":{"lib":"./"},"engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/stoeffel/underscore.string.fp.git"},"bugs":{"url":"https://github.com/stoeffel/underscore.string.fp/issues"},"licenses":[{"type":"MIT"}],"scripts":{"test":"gulp test"},"devDependencies":{"gulp":"3.8.10","gulp-browserify":"0.5.0","gulp-bump":"0.1.11","gulp-clean":"0.3.1","gulp-param":"0.6.3","gulp-qunit":"1.1.0","gulp-rename":"1.2.0","gulp-replace":"0.5.0","gulp-uglify":"1.0.1","ramda":"0.9.1"},"jshintConfig":{"node":true,"browser":true,"qunit":true,"globals":{"S":true}},"dependencies":{"chickencurry":"1.1.1","compose-function":"^2.0.0","reverse-arguments":"1.0.0","underscore.string":"3.0.3"},"gitHead":"3f7a879cc6efdbda2767a34ecf534cbdd1a1742c","_id":"underscore.string.fp@1.0.4","_shasum":"054b3f1843bcae561286c87de5e8879b4fc98364","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"schtoeffel","email":"schtoeffel@gmail.com"},"maintainers":[{"name":"schtoeffel","email":""}],"dist":{"shasum":"054b3f1843bcae561286c87de5e8879b4fc98364","size":31210,"noattachment":false,"key":"/underscore.string.fp/-/underscore.string.fp-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/underscore.string.fp/download/underscore.string.fp-1.0.4.tgz"},"publish_time":1428420503828,"_cnpm_publish_time":1428420503828,"_hasShrinkwrap":false},"1.0.3":{"name":"underscore.string.fp","version":"1.0.3","description":"This is a wrapper for underscore.string to use it as a FP-library or with a library like lodash-fp or ramda","homepage":"http://github.com/stoeffel/underscore.string.fp/","contributors":[{"name":"Christoph Hermannd","email":"schtoeffel@gmail.com","url":"<http://schtoeffel.ch>"}],"keywords":["ramda","string","underscore.string"],"main":"./index.js","directories":{"lib":"./"},"engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/stoeffel/underscore.string.fp.git"},"bugs":{"url":"https://github.com/stoeffel/underscore.string.fp/issues"},"licenses":[{"type":"MIT"}],"scripts":{"test":"gulp test"},"devDependencies":{"gulp":"~3.8.10","gulp-browserify":"~0.5.0","gulp-bump":"~0.1.11","gulp-clean":"~0.3.1","gulp-param":"~0.6.3","gulp-qunit":"~1.1.0","gulp-rename":"~1.2.0","gulp-replace":"~0.5.0","gulp-uglify":"~1.0.1","ramda":"^0.9.1"},"jshintConfig":{"node":true,"browser":true,"qunit":true,"globals":{"s":true}},"dependencies":{"chickencurry":"^1.1.1","compose-function":"^1.4.1","reverse-arguments":"^1.0.0","underscore.string":"^3.0.2"},"gitHead":"bbb76d5a221d19344dc22b122b146aae024eb3ca","_id":"underscore.string.fp@1.0.3","_shasum":"2b595436deb6f1f401d2f6b851a1357f4e58d77b","_from":".","_npmVersion":"2.1.10","_nodeVersion":"0.10.25","_npmUser":{"name":"schtoeffel","email":"schtoeffel@gmail.com"},"maintainers":[{"name":"schtoeffel","email":""}],"dist":{"shasum":"2b595436deb6f1f401d2f6b851a1357f4e58d77b","size":31012,"noattachment":false,"key":"/underscore.string.fp/-/underscore.string.fp-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/underscore.string.fp/download/underscore.string.fp-1.0.3.tgz"},"publish_time":1423084004334,"_cnpm_publish_time":1423084004334,"_hasShrinkwrap":false},"1.0.2":{"name":"underscore.string.fp","version":"1.0.2","description":"This is a wrapper for underscore.string to use it as a FP-library or with a library like ramda or lodash-fp","homepage":"http://github.com/stoeffel/underscore.string.fp/","contributors":[{"name":"Christoph Hermannd","email":"schtoeffel@gmail.com","url":"<http://schtoeffel.ch>"}],"keywords":["ramda","string","underscore.string"],"main":"./index.js","directories":{"lib":"./"},"engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/stoeffel/underscore.string.fp.git"},"bugs":{"url":"https://github.com/stoeffel/underscore.string.fp/issues"},"licenses":[{"type":"MIT"}],"scripts":{"test":"gulp test"},"devDependencies":{"gulp":"~3.8.10","gulp-browserify":"~0.5.0","gulp-bump":"~0.1.11","gulp-clean":"~0.3.1","gulp-param":"~0.6.3","gulp-qunit":"~1.1.0","gulp-rename":"~1.2.0","gulp-replace":"~0.5.0","gulp-uglify":"~1.0.1","ramda":"^0.9.1"},"jshintConfig":{"node":true,"browser":true,"qunit":true,"globals":{"s":true}},"dependencies":{"chickencurry":"^1.1.1","compose-function":"^1.4.1","reverse-arguments":"^1.0.0","underscore.string":"^3.0.2"},"gitHead":"79392fa310d7577fc219f2e7ae489b6027ac0f7b","_id":"underscore.string.fp@1.0.2","_shasum":"107c60e01ce85bca1ab140bb321664e2deae0a27","_from":".","_npmVersion":"2.1.10","_nodeVersion":"0.10.25","_npmUser":{"name":"schtoeffel","email":"schtoeffel@gmail.com"},"maintainers":[{"name":"schtoeffel","email":""}],"dist":{"shasum":"107c60e01ce85bca1ab140bb321664e2deae0a27","size":24301,"noattachment":false,"key":"/underscore.string.fp/-/underscore.string.fp-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/underscore.string.fp/download/underscore.string.fp-1.0.2.tgz"},"publish_time":1423083537450,"_cnpm_publish_time":1423083537450,"_hasShrinkwrap":false},"1.0.1":{"name":"underscore.string.fp","version":"1.0.1","description":"This is a wrapper for underscore.string to use it as a FP-library or with ramda","homepage":"http://github.com/stoeffel/underscore.string.fp/","contributors":[{"name":"Christoph Hermannd","email":"schtoeffel@gmail.com","url":"<http://schtoeffel.ch>"}],"keywords":["ramda","string","underscore.string"],"main":"./index.js","directories":{"lib":"./"},"engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/stoeffel/underscore.string.fp.git"},"bugs":{"url":"https://github.com/stoeffel/underscore.string.fp/issues"},"licenses":[{"type":"MIT"}],"scripts":{"test":"gulp test"},"devDependencies":{"gulp":"~3.8.10","gulp-browserify":"~0.5.0","gulp-bump":"~0.1.11","gulp-clean":"~0.3.1","gulp-param":"~0.6.3","gulp-qunit":"~1.1.0","gulp-rename":"~1.2.0","gulp-replace":"~0.5.0","gulp-uglify":"~1.0.1","ramda":"^0.9.1"},"jshintConfig":{"node":true,"browser":true,"qunit":true,"globals":{"s":true}},"dependencies":{"chickencurry":"^1.1.1","compose-function":"^1.4.1","reverse-arguments":"^1.0.0","underscore.string":"^3.0.2"},"gitHead":"15688e748290c6e5f4388930e1354c473081b57f","_id":"underscore.string.fp@1.0.1","_shasum":"89611100460f67f51d2b2a400ea630d50d39d159","_from":".","_npmVersion":"2.1.10","_nodeVersion":"0.10.25","_npmUser":{"name":"schtoeffel","email":"schtoeffel@gmail.com"},"maintainers":[{"name":"schtoeffel","email":""}],"dist":{"shasum":"89611100460f67f51d2b2a400ea630d50d39d159","size":24217,"noattachment":false,"key":"/underscore.string.fp/-/underscore.string.fp-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/underscore.string.fp/download/underscore.string.fp-1.0.1.tgz"},"publish_time":1423058056188,"_cnpm_publish_time":1423058056188,"_hasShrinkwrap":false},"1.0.0":{"name":"underscore.string.fp","version":"1.0.0","description":"This is an wrapper for underscore.string to use it as a FP-library or with ramda","homepage":"http://github.com/stoeffel/underscore.string.fp/","contributors":[{"name":"Christoph Hermannd","email":"schtoeffel@gmail.com","url":"<http://schtoeffel.ch>"}],"keywords":["ramda","string","underscore.string"],"main":"./index.js","directories":{"lib":"./"},"engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/stoeffel/underscore.string.fp.git"},"bugs":{"url":"https://github.com/stoeffel/underscore.string.fp/issues"},"licenses":[{"type":"MIT"}],"scripts":{"test":"gulp test"},"devDependencies":{"gulp":"~3.8.10","gulp-browserify":"~0.5.0","gulp-bump":"~0.1.11","gulp-clean":"~0.3.1","gulp-param":"~0.6.3","gulp-qunit":"~1.1.0","gulp-rename":"~1.2.0","gulp-replace":"~0.5.0","gulp-uglify":"~1.0.1","ramda":"^0.9.1"},"jshintConfig":{"node":true,"browser":true,"qunit":true,"globals":{"s":true}},"dependencies":{"chickencurry":"^1.1.1","compose-function":"^1.4.1","reverse-arguments":"^1.0.0","underscore.string":"^3.0.2"},"gitHead":"ea3d97c31b7ff79d506fa9b408b241267799c339","_id":"underscore.string.fp@1.0.0","_shasum":"bbfadbf7e85b982fb2a48d27989e5bb4c42fc148","_from":".","_npmVersion":"2.1.10","_nodeVersion":"0.10.25","_npmUser":{"name":"schtoeffel","email":"schtoeffel@gmail.com"},"maintainers":[{"name":"schtoeffel","email":""}],"dist":{"shasum":"bbfadbf7e85b982fb2a48d27989e5bb4c42fc148","size":24225,"noattachment":false,"key":"/underscore.string.fp/-/underscore.string.fp-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/underscore.string.fp/download/underscore.string.fp-1.0.0.tgz"},"publish_time":1423041844965,"_cnpm_publish_time":1423041844965,"_hasShrinkwrap":false}},"readme":"# Underscore.string.fp [![Build Status](https://secure.travis-ci.org/stoeffel/underscore.string.fp.png?branch=master)](http://travis-ci.org/stoeffel/underscore.string.fp) #\n\n> This is a wrapper for [underscore.string](http://epeli.github.io/underscore.string/) to use it as a FP-library or with a library like [lodash-fp](https://github.com/lodash/lodash-fp) or [Ramda](http://ramdajs.com)\n\n## Usage \n\n### In Node.js and Browserify\n\nInstall from npm\n\n    npm install underscore.string.fp\n\nRequire individual functions\n\n```javascript\nvar include = require(\"underscore.string.fp/include\");\n\nvar includeHello = include('Hello');\n\nincludeHello(\"Hello world!\");\n// => true\n\nincludeHello(\"Nope\");\n// => false\n```\n\nor load the full library to compose functions\n\n```javascript\nvar rockit = S(\n  S.titleize(),\n  S.insert('rocks', 9),\n  S.trim('_')\n);\n\n// S.titleize(S.insert('rocks', 9, S.trim('_', \"__stoeffel !__\")));\nrockit(\"__stoeffel !__\");\n// => \"Stoeffel Rocks!\"\n```\n\nbut especially when using with [Browserify][] the individual function approach\nis recommended because using it you only add those functions to your bundle you\nuse.\n\n[Browserify]: http://browserify.org/\n\n### Others\n\nThe `dist/underscore.string.fp.js` file is an [UMD][] build. You can load it using\nan AMD loader such as [RequireJS][] or just stick it to a web page and access\nthe library from the ***S*** global.\n\n[UMD]: https://github.com/umdjs/umd\n[RequireJS]: http://requirejs.org/\n\n### Ramda integration\n\nYou can use it with [ramda](ramdajs.com).\n\n```js\nR.map(S.camelize(), [\n  'Moo boo',\n  'Foo bar'\n]);\n// => ['mooBoo', 'fooBoo']\n```\n\n```js\nR.filter(S.startsWith('.'), [\n  '.vimrc',\n  'foo.md',\n  '.zshrc'\n]);\n// => ['.vimrc', '.zshrc']\n```\n\n### lodash-fp integration\n\nYou can use it with [lodash-fp](https://github.com/lodash/lodash-fp).\n\n```js\n_.map(S.camelize(), [\n  'Moo boo',\n  'Foo bar'\n]);\n// => ['mooBoo', 'fooBoo']\n```\n\n```js\n_.filter(S.startsWith('.'), [\n  '.vimrc',\n  'foo.md',\n  '.zshrc'\n]);\n// => ['.vimrc', '.zshrc']\n```\n\n## Download\n\n  * [Development version](https://raw.github.com/stoeffel/underscore.string.fp/master/dist/underscore.string.fp.js) *Uncompressed with Comments*\n  * [Production version](https://github.com/stoeffel/underscore.string.fp/raw/master/dist/underscore.string.fp.min.js) *Minified*\n\n## API\n\n### Individual functions\n\n#### numberFormat(number) => string\n\nFormats the numbers.\n\n```javascript\nnumberFormat(1000);\n// => \"1,000\"\n```\n\n#### numberFormatDecimal(decimals, number) => string\n\nFormats the numbers.\n\n```javascript\nnumberFormatDecimal(2)(1000);\n// => \"1,000.00\"\n```\n\n#### numberFormatSeparator(decimalSeparator, orderSeparator, decimal, number) => string\n\nFormats the numbers.\n\n```javascript\nnumberFormatSeparator(\".\", \"'\", 5, 123456789.123);\n// => \"123'456'789.12300\"\n```\n\n\n#### levenshtein(string1, string2) => number\n\nCalculates [Levenshtein distance][ld] between two strings.\n[ld]: http://en.wikipedia.org/wiki/Levenshtein_distance\n\n```javascript\nlevenshtein(\"kitten\")(\"kittah\");\n// => 2\n```\n\n#### capitalize(string) => string\n\nConverts first letter of the string to uppercase.\n\n```javascript\ncapitalize()(\"foo Bar\");\n// => \"Foo Bar\"\n\ncapitalize(\"foo Bar\");\n// => \"Foo Bar\"\n```\n\n#### decapitalize(string) => string\n\nConverts first letter of the string to lowercase.\n\n```javascript\ndecapitalize()(\"Foo Bar\");\n// => \"foo Bar\"\n\ndecapitalize(\"Foo Bar\");\n// => \"foo Bar\"\n```\n\n#### chop(step, string) => array\n\n```javascript\nchop(3)(\"whitespace\");\n// => [\"whi\", \"tes\", \"pac\", \"e\"]\n```\n\n#### clean(string) => string\n\nTrim and replace multiple spaces with a single space.\n\n```javascript\nclean()(\" foo    bar   \");\n// => \"foo bar\"\n\nclean(\" foo    bar   \");\n// => \"foo bar\"\n```\n\n#### chars(string) => array\n\n```javascript\nchars()(\"Hello\");\n// => [\"H\", \"e\", \"l\", \"l\", \"o\"]\n\nchars(\"Hello\");\n// => [\"H\", \"e\", \"l\", \"l\", \"o\"]\n```\n\n#### swapCase(string) => string\n\nReturns a copy of the string in which all the case-based characters have had their case swapped.\n\n```javascript\nswapCase()(\"hELLO\");\n// => \"Hello\"\n\nswapCase(\"hELLO\");\n// => \"Hello\"\n```\n\n#### include(substring, string) => boolean\n\nTests if string contains a substring.\n\n```javascript\ninclude(\"ob\")(\"foobar\");\n// => true\n```\n\n#### count(substring, string) => number\n\n```javascript\ncount(\"l\")(\"Hello world\");\n// => 3\n```\n\n#### escapeHTML(string) => string\n\nConverts HTML special characters to their entity equivalents.\n\n```javascript\nescapeHTML()(\"<div>Blah blah blah</div>\");\n// => \"&lt;div&gt;Blah blah blah&lt;/div&gt;\"\n\nescapeHTML(\"<div>Blah blah blah</div>\");\n// => \"&lt;div&gt;Blah blah blah&lt;/div&gt;\"\n```\n\n#### unescapeHTML(string) => string\n\nConverts entity characters to HTML equivalents.\n\n```javascript\nunescapeHTML()(\"&lt;div&gt;Blah blah blah&lt;/div&gt;\");\n// => \"<div>Blah blah blah</div>\"\n\nunescapeHTML(\"&lt;div&gt;Blah blah blah&lt;/div&gt;\");\n// => \"<div>Blah blah blah</div>\"\n```\n\n#### insert(substring, index, string) => string\n\n```javascript\ninsert(\"world\", 6)(\"Hello \");\n// => \"Hello world\"\n```\n\n#### replaceAll(replace, find, string) => string\n\n```javascript\nreplaceAll(\"a\")(\"o\")(\"foo\");\n// => \"faa\"\n```\n\n#### replaceAllIgnoreCase(replace, find, string) => string\n\n```javascript\nreplaceAll(\"a\")(\"o\")(\"fOo\");\n// => \"faa\"\n```\n\n#### isBlank(string) => boolean\n\n```javascript\nisBlank(\"\"); // => true\nisBlank(\"\\n\"); // => true\nisBlank(\" \"); // => true\nisBlank(\"a\"); // => false\n```\n\n#### join(separator, strings) => string\n\nJoins strings together with given separator\n\n```javascript\njoin(\" \")([\"foo\", \"bar\"]);\n// => \"foo bar\"\n```\n\n#### lines(str) => array\n\nSplit lines to an array\n\n```javascript\nlines()(\"Hello\\nWorld\");\n// => [\"Hello\", \"World\"]\n\nlines(\"Hello\\nWorld\");\n// => [\"Hello\", \"World\"]\n```\n\n#### dedent(str) => string\n\nDedent unnecessary indentation\n\nCredits go to @sindresorhus.\nThis implementation is similar to https://github.com/sindresorhus/strip-indent\n\n```javascript\ndedent()(\"  Hello\\n    World\");\n// => \"Hello\\n  World\"\n\ndedent(\"\\t\\tHello\\n\\t\\t\\t\\tWorld\");\n// => \"Hello\\n\\t\\tWorld\"\n```\n\n\n#### dedentPattern(pattern, str) => string\n\nDedent by a pattern.\n\n```javascript\ndedentPattern(\"  \")(\"    Hello\\n    World\"); // Dedent by 2 spaces\n// => \"  Hello\\n  World\"\n```\n\n#### reverse(string) => string\n\nReturn reversed string:\n\n```javascript\nreverse()(\"foobar\");\n// => \"raboof\"\n\nreverse(\"foobar\");\n// => \"raboof\"\n```\n\n#### splice(substring, howmany, index, string) => string\n\nLike an array splice.\n\n```javascript\nsplice(\"epeli\")(7)(30)(\"https://edtsech@bitbucket.org/edtsech/underscore.strings\");\n// => \"https://edtsech@bitbucket.org/epeli/underscore.strings\"\n```\n\n#### startsWith(starts, string) => boolean\n\nThis method checks whether the string begins with `starts`.\n\n```javascript\nstartsWith(\"image\")(\"image.gif\");\n// => true\n```\n\n#### startsWithAt(starts, position, string) => boolean\n\nThis method checks whether the string begins with `starts` at `position`.\n\n```javascript\nstartsWithAt(1)(\"vim\")(\".vimrc\");\n// => true\n```\n\n\n#### endsWith(ends, string) => boolean\n\nThis method checks whether the string ends with `ends`.\n\n```javascript\nendsWith(\"gif\")(\"image.gif\");\n// => true\n```\n\n#### endsWithAt(position, ends, string) => boolean\n\nThis method checks whether the string ends with `ends` at `position`.\n\n```javascript\nendsWithAt(9)(\"old\")(\"image.old.gif\");\n// => true\n```\n\n#### pred(string) => string\n\nReturns the predecessor to str.\n\n```javascript\npred()(\"b\");\n// => \"a\"\n\npred(\"B\");\n// => \"A\"\n```\n\n#### succ(string) => string\n\nReturns the successor to str.\n\n```javascript\nsucc()(\"a\");\n// => \"b\"\n\nsucc(\"A\");\n// => \"B\"\n```\n\n\n#### titleize(string) => string\n\n```javascript\ntitleize()(\"my name is epeli\");\n// => \"My Name Is Epeli\"\n\ntitleize(\"my name is epeli\");\n// => \"My Name Is Epeli\"\n```\n\n#### camelize(string) => string\n\nConverts underscored or dasherized string to a camelized one. \n\n```javascript\ncamelize(\"moz-transform\");\n// => \"mozTransform\"\n\ncamelize(\"-moz-transform\");\n// => \"mozTransform\"\n\ncamelize(\"_moz_transform\");\n// => \"mozTransform\"\n\ncamelize(\"Moz-transform\");\n// => \"mozTransform\"\n```\n\n#### pascalize(string) => string\n\nConverts underscored or dasherized string to a pascalized one. Begins with\na lower case letter unless it starts with an underscore, dash or an upper case letter.\n\n```javascript\npascalize(\"moz-transform\");\n// => \"mozTransform\"\n\npascalize(\"-moz-transform\");\n// => \"MozTransform\"\n\npascalize(\"_moz_transform\");\n// => \"MozTransform\"\n\npascalize(\"Moz-transform\");\n// => \"MozTransform\"\n```\n\n#### classify(string) => string\n\nConverts string to camelized class name. First letter is always upper case\n\n```javascript\nclassify()(\"some_class_name\");\n// => \"SomeClassName\"\n\nclassify(\"some_class_name\");\n// => \"SomeClassName\"\n```\n\n#### underscored(string) => string\n\nConverts a camelized or dasherized string into an underscored one\n\n```javascript\nunderscored()(\"MozTransform\");\n// => \"moz_transform\"\n\nunderscored(\"MozTransform\");\n// => \"moz_transform\"\n```\n\n#### dasherize(string) => string\n\nConverts a underscored or camelized string into an dasherized one\n\n```javascript\ndasherize()(\"MozTransform\");\n// => \"-moz-transform\"\n\ndasherize(\"MozTransform\");\n// => \"-moz-transform\"\n```\n\n#### humanize(string) => string\n\nConverts an underscored, camelized, or dasherized string into a humanized one.\nAlso removes beginning and ending whitespace, and removes the postfix '_id'.\n\n```javascript\nhumanize()(\"  capitalize dash-CamelCase_underscore trim  \");\n// => \"Capitalize dash camel case underscore trim\"\n\nhumanize(\"  capitalize dash-CamelCase_underscore trim  \");\n// => \"Capitalize dash camel case underscore trim\"\n```\n\n#### trim(characters, string) => string\n\nTrims defined characters from begining and ending of the string.\n\n```javascript\ntrim(' ')(\"  foobar   \");\n// => \"foobar\"\n\ntrim(\"_-foobar-_\", \"_-\");\n// => \"foobar\"\n```\n\n#### ltrim(characters, string) => string\n\nLeft trim. Similar to trim, but only for left side.\n\n#### rtrim(characters, string) => string\n\nRight trim. Similar to trim, but only for right side.\n\n#### truncate(truncateString, length, string) => string\n\n```javascript\ntruncate('...')(5)(\"Hello world\");\n// => \"Hello...\"\n\ntruncate('...')(10)(\"Hello\");\n// => \"Hello\"\n```\n\n#### prune(pruneString, length, string) => string\n\nElegant version of truncate.  Makes sure the pruned string does not exceed the\noriginal length.  Avoid half-chopped words when truncating.\n\n```javascript\nprune('...')(5)(\"Hello, world\");\n// => \"Hello...\"\n\nprune('...')(8)(\"Hello, world\");\n// => \"Hello...\"\n\nprune(\" (read a lot more)\")(5)(\"Hello, world\");\n// => \"Hello, world\" (as adding \"(read a lot more)\" would be longer than the original string)\n\nprune( '...')(1)(\"Hello, cruel world\");\n// => \"Hello, cruel...\"\n\nprune( '...')(1)(\"Hello\");\n// => \"Hello\"\n```\n\n#### words(str) => array\n\nSplit string by /\\s+/.\n\n```javascript\nwords()(\"   I   love   you   \");\n// => [\"I\", \"love\", \"you\"]\n\nwords(\"   \")\n// => []\n```\n\n#### wordsDelim(delimiter=/\\s+/, str) => array\n\nSplit string by delimiter (String or RegExp).\n\n```javascript\nwords(\"_\")(\"I_love_you\");\n// => [\"I\", \"love\", \"you\"]\n\nwords(/-/)(\"I-love-you\");\n// => [\"I\", \"love\", \"you\"]\n```\n\n#### sprintf(arguments, string format) => string\n\nC like string formatting.\nCredits goes to [Alexandru Marasteanu][o].\nFor more detailed documentation, see the [original page][o].\n\n[o]: http://www.diveintojavascript.com/projects/javascript-sprintf\n\n```javascript\nsprintf(1.17)(\"%.1f\");\n// => \"1.2\"\n```\n\n#### pad(padStr, length, str) => string\n\npads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`\" \"`). `padStr` is truncated to a single character if necessary.\n\n```javascript\npad(\" \")(8)(\"1\");\n// => \"       1\"\n\npad(\"0\")(8)(\"1\");\n// => \"00000001\"\n```\n\n#### lpad(padStr, length, str) => string\n\nleft-pad a string. Alias for `pad(str, length, padStr, \"left\")`\n\n```javascript\nlpad(\"0\")(8)(\"1\");\n// => \"00000001\"\n```\n\n#### rpad(padStr, length, str) => string\n\nright-pad a string. Alias for `pad(str, length, padStr, \"right\")`\n\n```javascript\nrpad(\"0\")(8)(\"1\");\n// => \"10000000\"\n```\n\n#### lrpad(padStr, length, str) => string\n\nleft/right-pad a string. Alias for `pad(str, length, padStr, \"both\")`\n\n```javascript\nlrpad('0')(8)(\"1\");\n// => \"00001000\"\n```\n\n\n#### toNumber(decimals, string) => number\n\nParse string to number. Returns NaN if string can't be parsed to number.\n\n```javascript\ntoNumber(0)(\"2.556\");\n// => 3\n\ntoNumber(1)(\"2.556\");\n// => 2.6\n\ntoNumber(-1)(\"999.999\");\n// => 990\n```\n\n#### strRight(pattern, string) => string\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\nstrRight(\"_\")(\"This_is_a_test_string\");\n// => \"is_a_test_string\"\n```\n\n#### strRightBack(pattern, string) => string\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\nstrRightBack(\"_\")(\"This_is_a_test_string\");\n// => \"string\"\n```\n\n#### strLeft(pattern, string) => string\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\nstrLeft(\"_\")(\"This_is_a_test_string\");\n// => \"This\";\n```\n\n#### strLeftBack(pattern, string) => string\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\nstrLeftBack(\"_\")(\"This_is_a_test_string\");\n// => \"This_is_a_test\";\n```\n\n#### stripTags(string) => string\n\nRemoves all html tags from string.\n\n```javascript\nstripTags()(\"a <a href=\"#\">link</a>\");\n// => \"a link\"\n\nstripTags(\"a <a href=\"#\">link</a><script>alert(\"hello world!\")</script>\");\n// => \"a linkalert(\"hello world!\")\"\n```\n\n#### toSentence(lastDelimiter, delimiter, array) => string\n\nJoin an array into a human readable sentence.\n\n```javascript\ntoSentence(\" and \")(\", \")(([\"jQuery\", \"Mootools\", \"Prototype\"]);\n// => \"jQuery, Mootools and Prototype\";\n\ntoSentence(\" unt \")(\", \")(([\"jQuery\", \"Mootools\", \"Prototype\"]);\n// => \"jQuery, Mootools unt Prototype\";\n```\n\n#### toSentenceSerial(lastDelimiter, delimiter, array) => string\n\nThe same as `toSentence`, but adjusts delimeters to use [Serial comma](http://en.wikipedia.org/wiki/Serial_comma).\n\n```javascript\ntoSentenceSerial(' and ')(', ')([\"jQuery\", \"Mootools\"]);\n// => \"jQuery and Mootools\"\n\ntoSentenceSerial(' and ')(', ')([\"jQuery\", \"Mootools\", \"Prototype\"]);\n// => \"jQuery, Mootools, and Prototype\"\n\ntoSentenceSerial(' unt ')(', ')([\"jQuery\", \"Mootools\", \"Prototype\"]);\n// => \"jQuery, Mootools, unt Prototype\"\n```\n\n#### repeat(separator, count, string) => string\n\nRepeats a string count times.\n\n```javascript\nrepeat('')(3)(\"foo\");\n// => \"foofoofoo\"\n\nrepeat(\"bar\")(3)(\"foo\");\n// => \"foobarfoobarfoo\"\n```\n\n#### surround(wrap, string) => string\n\nSurround a string with another string.\n\n```javascript\nsurround(\"ab\")(\"foo\");\n// => \"abfooab\"\n```\n\n#### quote(quoteChar, string) or q(quoteChar, string) => string\n\nQuotes a string. `quoteChar`.\n\n```javascript\nquote('\"')(\"foo\");\n// => '\"foo\"';\n```\n\n#### unquote(quoteChar, string) => string\n\nUnquotes a string. `quoteChar`.\n\n```javascript\nunquote('\"')('\"foo\"');\n// => \"foo\"\n\nunquote(\"'\")(\"'foo'\");\n// => \"foo\"\n```\n\n\n#### slugify(string) => string\n\nTransform text into an ascii slug which can be used in safely in URLs. Replaces whitespaces, accentuated, and special characters with a dash. Limited set of non-ascii characters are transformed to similar versions in the ascii character set such as `ä` to `a`.\n\n```javascript\nslugify()(\"Un éléphant à l\\'orée du bois\");\n// => \"un-elephant-a-l-oree-du-bois\"\n\nslugify(\"Un éléphant à l\\'orée du bois\");\n// => \"un-elephant-a-l-oree-du-bois\"\n```\n\n***Caution: this function is charset dependent***\n\n#### naturalCmp(string1, string2) => number\n\nNaturally sort strings like humans would do. None numbers are compared by their [ASCII values](http://www.asciitable.com/). Note: this means \"a\" > \"A\". Use `.toLowerCase` if this isn't to be desired.\n\nJust past it to `Array#sort`.\n\n```javascript\n[\"foo20\", \"foo5\"].sort(naturalCmp);\n// => [\"foo5\", \"foo20\"]\n```\n\n#### toBoolean(string) => boolean\n\nTurn strings that can be commonly considered as booleas to real booleans. Such as \"true\", \"false\", \"1\" and \"0\". This function is case insensitive.\n\n```javascript\ntoBoolean(\"true\");\n// => true\n\ntoBoolean(\"FALSE\");\n// => false\n\ntoBoolean(\"random\");\n// => undefined\n```\n\n### Library functions\n\nIf you require the full library you can use composing and aliases\n\n#### s(functions) => function\n\nCompose new functions.\n\n```javascript\nvar rockit = S(\n  S.titleize(),\n  S.insert('rocks', 9),\n  S.trim('_')\n);\n\n// S.titleize(S.insert('rocks', 9, S.trim('_', \"__stoeffel !__\")));\nrockit(\"__stoeffel !__\");\n// => \"Stoeffel Rocks!\"\n```\n\n\n#### Aliases\n\n```javascript\nstrip     = trim\nlstrip    = ltrim\nrstrip    = rtrim\ncenter    = lrpad\nrjust     = lpad\nljust     = rpad\ncontains  = include\nq         = quote\ntoBool    = toBoolean\ncamelcase = camelize\n```\n\n## Maintainers ##\n\nThis library is maintained by\n\n  - Christoph Hermann – ***[@stoeffel](https://github.com/stoeffel)***\n\n## Licence ##\n\nThe MIT License\n\nCopyright (c) 2015 Christoph Hermann schtoeffel@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n\n[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object\n","_attachments":{},"homepage":"http://github.com/stoeffel/underscore.string.fp/","bugs":{"url":"https://github.com/stoeffel/underscore.string.fp/issues"}}