|
|
![[home]](http://htdb.org/images/blank.gif) |
|
class: Strings
${truncAt(target, string)}
|
input | ${truncAt(world, hello world)} |
|
yields | hello
|
${shh(string)}
|
input | ${shh(hello world)} |
|
yields |
|
|
input | ${shh(anything)} |
|
yields |
|
${nonalnum2underscore(string)}
|
input | ${nonalnum2underscore(hello world!)} |
|
yields | hello_world_
|
${space2underscore(string)}
|
input | ${space2underscore(hello world!)} |
|
yields | hello_world!
|
${reverse(string)}
|
input | ${reverse(hello world!)} |
|
yields | !dlrow olleh
|
${eatWhitespace(string)}
|
input | ${eatWhitespace(hello world!)} |
|
yields | helloworld!
|
${lower(string)}
|
input | ${lower(HeLlO wOrLd!)} |
|
yields | hello world!
|
${upper(string)}
|
input | ${upper(HeLlO wOrLd!)} |
|
yields | HELLO WORLD!
|
${pretty(string)}
|
input | ${pretty(HeLlO wOrLd!)} |
|
yields | Hello World!
|
|
input | ${pretty(bunch-o-text wow)} |
|
yields | Bunch-O-Text Wow
|
${substr(start, count, string)}
|
input | ${substr(0, 4, hello world)} |
|
yields | hell
|
|
input | ${substr(4, 4, hello world)} |
|
yields | o wo
|
|
input | ${substr(4, -4, hello world)} |
|
yields | ello
|
|
input | ${substr(4, 1000, hello world)} |
|
yields | o world
|
${trunc(maxlen, string)}
|
input | ${trunc(4, hello world)} |
|
yields | hell..
|
|
input | ${trunc(1000, hello world)} |
|
yields | hello world
|
|
input | ${trunc(0, hello world)} |
|
yields | ..
|
${strlen(string)}
|
input | ${strlen(hello world)} |
|
yields | 11
|
${dbSafe(string)}
|
input | ${dbSafe(we'd "like" $more$ money)} |
|
yields | we'd like more money
|
${pluralize(num, singular, plural)}
|
input | ${pluralize(0, adjective, adjectives)} |
|
yields | no adjectives
|
|
input | ${pluralize(1, adjective, adjectives)} |
|
yields | 1 adjective
|
|
input | ${pluralize(6, adjective, adjectives)} |
|
yields | 6 adjectives
|
${formSafe(string)}
|
input | ${formSafe(we'd "like" $more$ money)} |
|
yields | we'd 'like' $more$ money
|
${prettyWrap([margin,]string)}
|
input | ${prettyWrap(100,when in the course of human events)} |
|
yields | when in the course of human events
|
|
input | ${prettyWrap(20,when in the course of human events)} |
|
yields | when in the course of
human events
|
|
input | ${prettyWrap(5,when in the course of human events)} |
|
yields | when in
the course
of human
events
|
|
input | ${prettyWrap(0,when in the course of human events)} |
|
yields | 0,when
in
the
course
of
human
events
|
|
input | ${prettyWrap(when in the course of human events)} |
|
yields | when
in
the
course
of
human
events
|
|
|