string-tools
Example
var s = ;
- string-tools
- .symbol
- .escapeRegExp()
- .fill(fillWith, len) ⇒
string
- .padRight(input, width, [padWith]) ⇒
string
- .repeat(input, times) ⇒
string
- .clipLeft(input, width, [prefix]) ⇒
string
s.symbol
some cross platform symbols (tick
and cross
)
Kind: static property of string-tools
s.escapeRegExp()
escape special regular expression characters
Kind: static method of string-tools
Example
> s;'\\(\\.\\*\\)'
string
s.fill(fillWith, len) ⇒ Create a new string filled with the supplied character
Kind: static method of string-tools
Param | Type | Description |
---|---|---|
fillWith | string |
the fill character |
len | number |
the length of the output string |
Example
> s'aaaaaaaaaa'> s'aaaaaaaaaa'
string
s.padRight(input, width, [padWith]) ⇒ Add padding to the right of a string
Kind: static method of string-tools
Param | Type | Default | Description |
---|---|---|---|
input | string |
the string to pad | |
width | number |
the desired final width | |
[padWith] | string |
"" "" |
the padding character |
Example
> s'clive'> s'clive'> s'clive-----'
string
s.repeat(input, times) ⇒ returns the input string repeated the specified number of times
Kind: static method of string-tools
Param | Type | Description |
---|---|---|
input | string |
input string to repeat |
times | number |
the number of times to repeat |
string
s.clipLeft(input, width, [prefix]) ⇒ returns the input string clipped from the left side in order to meet the specified width
Kind: static method of string-tools
Param | Type | Default | Description |
---|---|---|---|
input | string |
input string to repeat | |
width | number |
the desired final width | |
[prefix] | string |
"..." |
the prefix to replace the clipped region |
© 2015 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.