(index ("s-trim" 0) ("s-trim-left" 281) ("s-trim-right" 500) ("s-chomp" 717) ("s-collapse-whitespace" 1055) ("s-center" 1443) ("s-truncate" 1722) ("s-left" 2082) ("s-right" 2298) ("s-chop-suffix" 2517) ("s-chop-suffixes" 2882) ("s-chop-prefix" 3322) ("s-chop-prefixes" 3615) ("s-shared-start" 3967) ("s-shared-end" 4281) ("s-repeat" 4582) ("s-concat" 4849) ("s-prepend" 5036) ("s-append" 5219) ("s-lines" 5399) ("s-match" 5741) ("s-match-multiple" 6244) ("s-split" 6800) ("s-join" 7288) ("s-chop" 7597) ("s-equals?" 7909) ("s-matches?" 8183) ("s-blank?" 8406) ("s-ends-with?" 8573) ("s-starts-with?" 9015) ("s-contains?" 9447) ("s-lowercase?" 9863) ("s-uppercase?" 10104) ("s-mixedcase?" 10361) ("s-capitalized?" 10633) ("s-titleized?" 10945) ("s-numeric?" 11263) ("s-replace" 11443) ("s-downcase" 11744) ("s-upcase" 11967) ("s-capitalize" 12181) ("s-titleize" 12460) ("s-index-of" 12794) ("s-reverse" 13209) ("s-split-words" 13432) ("s-lower-camel-case" 13773) ("s-upper-camel-case" 14103) ("s-snake-case" 14433) ("s-dashed-words" 14729) ("s-capitalized-words" 15049) ("s-titleized-words" 15399) ("s-unique-words" 15737))
(def (sig (procedure " (s-trim s)" (id s-trim))) (p "Remove whitespace at the beginning and end of " (tt "s") ".") (highlight scheme "(s-trim \"trim \") ;; => \"trim\"\n(s-trim \" this\") ;; => \"this\"\n(s-trim \" only  trims beg and end  \") ;; => \"only  trims beg and end\""))
(def (sig (procedure " (s-trim-left s)" (id s-trim-left))) (p "Remove whitespace at the beginning of " (tt "s") ".") (highlight scheme "(s-trim-left \"trim \") ;; => \"trim \"\n(s-trim-left \" this\") ;; => \"this\""))
(def (sig (procedure " (s-trim-right s)" (id s-trim-right))) (p "Remove whitespace at the end of " (tt "s") ".") (highlight scheme "(s-trim-right \"trim \") ;; => \"trim\"\n(s-trim-right \" this\") ;; => \" this\""))
(def (sig (procedure " (s-chomp s)" (id s-chomp))) (p "Remove one trailing " (tt "\\n") ", " (tt "\\r") " or " (tt "\\r\\n") " from " (tt "s") ".") (highlight scheme "(s-chomp \"no newlines\\n\") ;; => \"no newlines\"\n(s-chomp \"no newlines\\r\\n\") ;; => \"no newlines\"\n(s-chomp \"some newlines\\n\\n\") ;; => \"some newlines\\n\""))
(def (sig (procedure " (s-collapse-whitespace s)" (id s-collapse-whitespace))) (p "Convert all adjacent whitespace characters in " (tt "s") " to a single space.") (highlight scheme "(s-collapse-whitespace \"only   one space   please\") ;; => \"only one space please\"\n(s-collapse-whitespace \"collapse \\n all \\t sorts of \\r whitespace\") ;; => \"collapse all sorts of whitespace\""))
(def (sig (procedure " (s-center len s)" (id s-center))) (p "If " (tt "s") " is shorter than " (tt "len") ", pad it with spaces so it is centered.") (highlight scheme "(s-center 5 \"a\") ;; => \"  a  \"\n(s-center 5 \"ab\") ;; => \"  ab \"\n(s-center 1 \"abc\") ;; => \"abc\""))
(def (sig (procedure " (s-truncate len s)" (id s-truncate))) (p "If " (tt "s") " is longer than " (tt "len") ", cut it down and add ... at the end.") (highlight scheme "(s-truncate 6 \"This is too long\") ;; => \"Thi...\"\n(s-truncate 16 \"This is also too long\") ;; => \"This is also ...\"\n(s-truncate 16 \"But this is not!\") ;; => \"But this is not!\""))
(def (sig (procedure " (s-left len s)" (id s-left))) (p "Returns up to the " (tt "len") " first chars of " (tt "s") ".") (highlight scheme "(s-left 3 \"lib/file.js\") ;; => \"lib\"\n(s-left 3 \"li\") ;; => \"li\""))
(def (sig (procedure " (s-right len s)" (id s-right))) (p "Returns up to the " (tt "len") " last chars of " (tt "s") ".") (highlight scheme "(s-right 3 \"lib/file.js\") ;; => \".js\"\n(s-right 3 \"li\") ;; => \"li\""))
(def (sig (procedure " (s-chop-suffix suffix s)" (id s-chop-suffix))) (p "Remove " (tt "suffix") " if it is at end of " (tt "s") ".") (highlight scheme "(s-chop-suffix \"-test.js\" \"penguin-test.js\") ;; => \"penguin\"\n(s-chop-suffix \"\\n\" \"no newlines\\n\") ;; => \"no newlines\"\n(s-chop-suffix \"\\n\" \"some newlines\\n\\n\") ;; => \"some newlines\\n\""))
(def (sig (procedure " (s-chop-suffixes suffixes s)" (id s-chop-suffixes))) (p "Remove " (tt "suffixes") " one by one in order, if they are at the end of " (tt "s") ".") (highlight scheme "(s-chop-suffixes '(\"_test.js\" \"-test.js\" \"Test.js\") \"penguin-test.js\") ;; => \"penguin\"\n(s-chop-suffixes '(\"\\r\" \"\\n\") \"penguin\\r\\n\") ;; => \"penguin\\r\"\n(s-chop-suffixes '(\"\\n\" \"\\r\") \"penguin\\r\\n\") ;; => \"penguin\""))
(def (sig (procedure " (s-chop-prefix prefix s)" (id s-chop-prefix))) (p "Remove " (tt "prefix") " if it is at the start of " (tt "s") ".") (highlight scheme "(s-chop-prefix \"/tmp\" \"/tmp/file.js\") ;; => \"/file.js\"\n(s-chop-prefix \"/tmp\" \"/tmp/tmp/file.js\") ;; => \"/tmp/file.js\""))
(def (sig (procedure " (s-chop-prefixes prefixes s)" (id s-chop-prefixes))) (p "Remove " (tt "prefixes") " one by one in order, if they are at the start of " (tt "s") ".") (highlight scheme "(s-chop-prefixes '(\"/tmp\" \"/my\") \"/tmp/my/file.js\") ;; => \"/file.js\"\n(s-chop-prefixes '(\"/my\" \"/tmp\") \"/tmp/my/file.js\") ;; => \"/my/file.js\""))
(def (sig (procedure " (s-shared-start s1 s2)" (id s-shared-start))) (p "Returns the longest prefix " (tt "s1") " and " (tt "s2") " have in common.") (highlight scheme "(s-shared-start \"bar\" \"baz\") ;; => \"ba\"\n(s-shared-start \"foobar\" \"foo\") ;; => \"foo\"\n(s-shared-start \"bar\" \"foo\") ;; => \"\""))
(def (sig (procedure " (s-shared-end s1 s2)" (id s-shared-end))) (p "Returns the longest suffix " (tt "s1") " and " (tt "s2") " have in common.") (highlight scheme "(s-shared-end \"bar\" \"var\") ;; => \"ar\"\n(s-shared-end \"foo\" \"foo\") ;; => \"foo\"\n(s-shared-end \"bar\" \"foo\") ;; => \"\""))
(def (sig (procedure " (s-repeat num s)" (id s-repeat))) (p "Make a string of " (tt "s") " repeated " (tt "num") " times.") (highlight scheme "(s-repeat 10 \" \") ;; => \"          \"\n(s-concat (s-repeat 8 \"Na\") \" Batman!\") ;; => \"NaNaNaNaNaNaNaNa Batman!\""))
(def (sig (procedure " (s-concat s ...)" (id s-concat))) (p "Join all the string arguments into one string.") (highlight scheme "(s-concat \"abc\" \"def\" \"ghi\") ;; => \"abcdefghi\""))
(def (sig (procedure " (s-prepend prefix s)" (id s-prepend))) (p "Concatenate " (tt "prefix") " and " (tt "s") ".") (highlight scheme "(s-prepend \"abc\" \"def\") ;; => \"abcdef\""))
(def (sig (procedure " (s-append suffix s)" (id s-append))) (p "Concatenate " (tt "s") " and " (tt "suffix") ".") (highlight scheme "(s-append \"abc\" \"def\") ;; => \"defabc\""))
(def (sig (procedure " (s-lines s)" (id s-lines))) (p "Splits " (tt "s") " into a list of strings on newline characters.") (highlight scheme "(s-lines \"abc\\ndef\\nghi\") ;; => '(\"abc\" \"def\" \"ghi\")\n(s-lines \"abc\\rdef\\rghi\") ;; => '(\"abc\" \"def\" \"ghi\")\n(s-lines \"abc\\r\\ndef\\r\\nghi\") ;; => '(\"abc\" \"def\" \"ghi\")"))
(def (sig (procedure " (s-match regexp s)" (id s-match))) (p "When the given expression matches the string, this function returns a list of the whole matching string and a string for each matched subexpression.  If it did not match the returned value is an empty list '().") (highlight scheme "(s-match \"^def\" \"abcdefg\") ;; => '()\n(s-match \"^abc\" \"abcdefg\") ;; => '(\"abc\")\n(s-match \"^.*/([a-z]+).([a-z]+)\" \"/some/weird/file.html\") ;; => '(\"/some/weird/file.html\" \"file\" \"html\")"))
(def (sig (procedure " (s-match-multiple regexp s)" (id s-match-multiple))) (p "Returns a list of all matches to " (tt "regexp") " in " (tt "s") ".") (highlight scheme "(s-match-multiple \"[[:digit:]]{4}\" \"Grab (1234) four-digit (4321) numbers (4567)\") ;; => (\"1234\" \"4321\" \"4567\")\n(s-match-multiple \"<.+?>\" \"<html> <body> Some text </body> </html>\") ;; => (\"<html>\" \"<body>\" \"</body>\" \"</html>\")\n(s-match-multiple \"foo-[0-9]{2}\" \"foo-10 foo-11 foo-1 foo-2 foo-100 foo-21\") ;; => (\"foo-10\" \"foo-11\" \"foo-10\" \"foo-21\")"))
(def (sig (procedure " (s-split separators s [keepempty])" (id s-split))) (p "Splits " (tt "s") " into substrings bounded by matches for " (tt "separators") ". If " (tt "keepempty") " is #t, zero-length substrings are returned.") (highlight scheme "(s-split \" \" \"one  two  three\") ;; => (\"one\" \"two\" \"three\")\n(s-split \":\" \"foo:bar::baz\" #t) ;; => (\"foo\" \"bar\" \"\" \"baz\")\n(s-split \":,\" \"foo:bar:baz,quux,zot\") ;; => (\"foo\" \"bar\" \"baz\" \"quux\" \"zot\")"))
(def (sig (procedure " (s-join separator strings)" (id s-join))) (p "Join all the strings in " (tt "strings") " with " (tt "separator") " in between.") (highlight scheme "(s-join \"+\" '(\"abc\" \"def\" \"ghi\")) ;; => \"abc+def+ghi\"\n(s-join \"\\n\" '(\"abc\" \"def\" \"ghi\")) ;; => \"abc\\ndef\\nghi\""))
(def (sig (procedure " (s-chop len s)" (id s-chop))) (p "Return a list of substrings taken by chopping " (tt "s") " every " (tt "len") " characters.") (highlight scheme "(s-chop 4 \"1234567890\") ;; => (\"1234\" \"5678\" \"90\")\n(s-chop 3 \"i-1i-2i-3i-4i-5\") ;; => (\"i-1\" \"i-2\" \"i-3\" \"i-4\" \"i-5\")"))
(def (sig (procedure " (s-equals? s1 s2)" (id s-equals?))) (p "Is " (tt "s1") " equal to " (tt "s2") "?") (p "This is a simple wrapper around the built-in " (tt "string=") ".") (highlight scheme "(s-equals? \"abc\" \"ABC\") ;; => #f\n(s-equals? \"abc\" \"abc\") ;; => #t"))
(def (sig (procedure " (s-matches? regexp s)" (id s-matches?))) (p "Does " (tt "regexp") " match " (tt "s") "?") (highlight scheme "(s-matches? \"^[0-9]+$\" \"123\") ;; => #t\n(s-matches? \"^[0-9]+$\" \"a123\") ;; => #f"))
(def (sig (procedure " (s-blank? s)" (id s-blank?))) (p "Is " (tt "s") " the empty string?") (highlight scheme "(s-blank? \"\") ;; => #t\n(s-blank? \" \") ;; => #f"))
(def (sig (procedure " (s-ends-with? suffix s [ignore-case])" (id s-ends-with?))) (p "Does " (tt "s") " end with " (tt "suffix") "?") (p "If " (tt "ignore-case") " is non-#f, the comparison is done without paying attention to case differences.") (p "Alias: " (tt "s-suffix?")) (highlight scheme "(s-ends-with? \".md\" \"readme.md\") ;; => #t\n(s-ends-with? \".MD\" \"readme.md\") ;; => #f\n(s-ends-with? \".MD\" \"readme.md\" #t) ;; => #t"))
(def (sig (procedure " (s-starts-with? prefix s [ignore-case])" (id s-starts-with?))) (p "Does " (tt "s") " start with " (tt "prefix") "?") (p "If " (tt "ignore-case") " is non-#f, the comparison is done without paying attention to case differences.") (highlight scheme "(s-starts-with? \"lib/\" \"lib/file.js\") ;; => #t\n(s-starts-with? \"LIB/\" \"lib/file.js\") ;; => #f\n(s-starts-with? \"LIB/\" \"lib/file.js\" #t) ;; => #t"))
(def (sig (procedure " (s-contains? needle s [ignore-case])" (id s-contains?))) (p "Does " (tt "s") " contain " (tt "needle") "?") (p "If " (tt "ignore-case") " is non-#f, the comparison is done without paying attention to case differences.") (highlight scheme "(s-contains? \"file\" \"lib/file.js\") ;; => #t\n(s-contains? \"nope\" \"lib/file.js\") ;; => #f\n(s-contains? \"^a\" \"it's not ^a regexp\") ;; => #t"))
(def (sig (procedure " (s-lowercase? s)" (id s-lowercase?))) (p "Are all the letters in " (tt "s") " in lower case?") (highlight scheme "(s-lowercase? \"file\") ;; => #t\n(s-lowercase? \"File\") ;; => #f\n(s-lowercase? \"123?\") ;; => #t"))
(def (sig (procedure " (s-uppercase? s)" (id s-uppercase?))) (p "Are all the letters in " (tt "s") " in upper case?") (highlight scheme "(s-uppercase? \"HULK SMASH\") ;; => #t\n(s-uppercase? \"Bruce no smash\") ;; => #f\n(s-uppercase? \"123?\") ;; => #t"))
(def (sig (procedure " (s-mixedcase? s)" (id s-mixedcase?))) (p "Are there both lower case and upper case letters in " (tt "s") "?") (highlight scheme "(s-mixedcase? \"HULK SMASH\") ;; => #f\n(s-mixedcase? \"Bruce no smash\") ;; => #t\n(s-mixedcase? \"123?\") ;; => #f"))
(def (sig (procedure " (s-capitalized? s)" (id s-capitalized?))) (p "In " (tt "s") ", is the first letter upper case, and all other letters lower case?") (highlight scheme "(s-capitalized? \"Capitalized\") ;; => #t\n(s-capitalized? \"I am capitalized\") ;; => #t\n(s-capitalized? \"I Am Titleized\") ;; => #f"))
(def (sig (procedure " (s-titleized? s)" (id s-titleized?))) (p "In " (tt "s") ", is the first letter of each word upper case, and all other letters lower case?") (highlight scheme "(s-titleized? \"Titleized\") ;; => #t\n(s-titleized? \"I Am Titleized\") ;; => #t\n(s-titleized? \"I am only capitalized\") ;; => #f"))
(def (sig (procedure " (s-numeric? s)" (id s-numeric?))) (p "Is " (tt "s") " a number?") (highlight scheme "(s-numeric? \"123\") ;; => #t\n(s-numeric? \"onetwothree\") ;; => #f"))
(def (sig (procedure " (s-replace old new s)" (id s-replace))) (p "Replaces " (tt "old") " with " (tt "new") " in " (tt "s") ".") (highlight scheme "(s-replace \"file\" \"nope\" \"lib/file.js\") ;; => \"lib/nope.js\"\n(s-replace \"^a\" \"---\" \"it's not ^a regexp\") ;; => \"it's not --- regexp\""))
(def (sig (procedure " (s-downcase s)" (id s-downcase))) (p "Convert " (tt "s") " to lower case.") (p "This is a simple wrapper around  " (tt "string-downcase") ".") (highlight scheme "(s-downcase \"ABC\") ;; => \"abc\""))
(def (sig (procedure " (s-upcase s)" (id s-upcase))) (p "Convert " (tt "s") " to upper case.") (p "This is a simple wrapper around " (tt "string-upcase") ".") (highlight scheme "(s-upcase \"abc\") ;; => \"ABC\""))
(def (sig (procedure " (s-capitalize s)" (id s-capitalize))) (p "Convert the first word's first character to upper case and the rest to lower case in " (tt "s") ".") (highlight scheme "(s-capitalize \"abc DEF\") ;; => \"Abc def\"\n(s-capitalize \"abc.DEF\") ;; => \"Abc.def\""))
(def (sig (procedure " (s-titleize s)" (id s-titleize))) (p "Convert each word's first character to upper case and the rest to lower case in " (tt "s") ".") (p "This is a simple wrapper around  " (tt "string-titlecase") ".") (highlight scheme "(s-titleize \"abc DEF\") ;; => \"Abc Def\"\n(s-titleize \"abc.DEF\") ;; => \"Abc.Def\""))
(def (sig (procedure " (s-index-of needle s [ignore-case])" (id s-index-of))) (p "Returns first index of " (tt "needle") " in " (tt "s") ", or #f.") (p "If " (tt "ignore-case") " is non-#f, the comparison is done without paying attention to case differences.") (highlight scheme "(s-index-of \"abc\" \"abcdef\") ;; => 0\n(s-index-of \"CDE\" \"abcdef\" #t) ;; => 2\n(s-index-of \"n.t\" \"not a regexp\") ;; => #f"))
(def (sig (procedure " (s-reverse s)" (id s-reverse))) (p "Return the reverse of " (tt "s") ".") (highlight scheme "(s-reverse \"abc\") ;; => \"cba\"\n(s-reverse \"ab xyz\") ;; => \"zyx ba\"\n(s-reverse \"\") ;; => \"\""))
(def (sig (procedure " (s-split-words s)" (id s-split-words))) (p "Split " (tt "s") " into list of words.") (highlight scheme "(s-split-words \"under_score\") ;; => '(\"under\" \"score\")\n(s-split-words \"some-dashed-words\") ;; => '(\"some\" \"dashed\" \"words\")\n(s-split-words \"evenCamelCase\") ;; => '(\"even\" \"Camel\" \"Case\")"))
(def (sig (procedure " (s-lower-camel-case s)" (id s-lower-camel-case))) (p "Convert " (tt "s") " to lowerCamelCase.") (highlight scheme "(s-lower-camel-case \"some words\") ;; => \"someWords\"\n(s-lower-camel-case \"dashed-words\") ;; => \"dashedWords\"\n(s-lower-camel-case \"under_scored_words\") ;; => \"underScoredWords\""))
(def (sig (procedure " (s-upper-camel-case s)" (id s-upper-camel-case))) (p "Convert " (tt "s") " to UpperCamelCase.") (highlight scheme "(s-upper-camel-case \"some words\") ;; => \"SomeWords\"\n(s-upper-camel-case \"dashed-words\") ;; => \"DashedWords\"\n(s-upper-camel-case \"under_scored_words\") ;; => \"UnderScoredWords\""))
(def (sig (procedure " (s-snake-case s)" (id s-snake-case))) (p "Convert " (tt "s") " to snake_case.") (highlight scheme "(s-snake-case \"some words\") ;; => \"some_words\"\n(s-snake-case \"dashed-words\") ;; => \"dashed_words\"\n(s-snake-case \"camelCasedWords\") ;; => \"camel_cased_words\""))
(def (sig (procedure " (s-dashed-words s)" (id s-dashed-words))) (p "Convert " (tt "s") " to dashed-words.") (highlight scheme "(s-dashed-words \"some words\") ;; => \"some-words\"\n(s-dashed-words \"under_scored_words\") ;; => \"under-scored-words\"\n(s-dashed-words \"camelCasedWords\") ;; => \"camel-cased-words\""))
(def (sig (procedure " (s-capitalized-words s)" (id s-capitalized-words))) (p "Convert " (tt "s") " to Capitalized Words.") (highlight scheme "(s-capitalized-words \"some words\") ;; => \"Some words\"\n(s-capitalized-words \"under_scored_words\") ;; => \"Under scored words\"\n(s-capitalized-words \"camelCasedWords\") ;; => \"Camel cased words\""))
(def (sig (procedure " (s-titleized-words s)" (id s-titleized-words))) (p "Convert " (tt "s") " to Titleized Words.") (highlight scheme "(s-titleized-words \"some words\") ;; => \"Some Words\"\n(s-titleized-words \"under_scored_words\") ;; => \"Under Scored Words\"\n(s-titleized-words \"camelCasedWords\") ;; => \"Camel Cased Words\""))
(def (sig (procedure " (s-unique-words s)" (id s-unique-words))) (p "Return list of unique words in " (tt "s") ".") (highlight scheme "(s-unique-words \"Forget redundancy about about redundancy\") ;; => (\"Forget\" \"about\" \"redundancy\")\n(s-unique-words \"unique-dashed-words-dashed-words-too\") ;; => (\"unique\" \"dashed\" \"words\" \"too\")\n(s-unique-words \"camelCase_words and_and underscore_words_too\") ;; => (\"camel\" \"Case\" \"and\" \"underscore\" \"words\" \"too\")"))
