Namespace: string

string

Source:
index.js

Methods


<static> bin2Hex(bin)

Bin to hex, like 0x7F

Parameters:
Name Type Description
bin Buffer
Source:
string/bin2Hex.js
Returns:
Type
String

<static> camelCase(str)

Convert a string to camel case, 'fooBar'

Parameters:
Name Type Description
str String
Source:
string/camelCase.js
Returns:
Type
String

<static> compile(str [, settings])

Parameters:
Name Type Argument Description
str String
settings Object <optional>

Template settings, https://lodash.com/docs/4.17.15#template

Source:
string/compile.js
Returns:
Type
Template

<static> dropIfEndsWith(str, ending)

Drop a right part of a string if it ends with ending

Parameters:
Name Type Description
str String
ending String
Source:
string/dropIfEndsWith.js
Returns:
Type
String

<static> ensureEndsWith(str, ending)

Ensure a string ends with ending

Parameters:
Name Type Description
str String
ending String
Source:
string/ensureEndsWith.js
Returns:
Type
String

<static> ensureStartsWith(str, starting)

Ensure a string starts with starting

Parameters:
Name Type Description
str String
starting String
Source:
string/ensureStartsWith.js
Returns:
Type
String

<static> isQuoted(s)

Check a string if it is quoted with " or '

Parameters:
Name Type Description
s String
Source:
string/isQuoted.js
Returns:
Type
boolean

<static> isWrappedWith(s, q)

Check a string if it is started and ended with a given sub-string

Parameters:
Name Type Description
s String

String to check

q String

Sub-srting

Source:
string/isWrappedWith.js
Returns:
Type
boolean

<static> kebabCase(str)

Convert a string to kebab case, 'foo-bar'

Parameters:
Name Type Description
str String
Source:
string/kebabCase.js
Returns:
Type
String

<static> pascalCase(str)

Convert a string to pascal case, 'fooBar'

Parameters:
Name Type Description
str String
Source:
string/pascalCase.js
Returns:
Type
String

<static> quote(str [, quoteChar])

Quote a string.

Parameters:
Name Type Argument Default Description
str String
quoteChar String <optional>
'
Source:
string/quote.js
Returns:
Type
String

<static> replaceAll(str, search, replacement)

Replace all occurance of "search" with "replacement" in a string.
3.5x faster than String.replaceAll

Parameters:
Name Type Description
str String
search String
replacement String
Source:
string/replaceAll.js
See:

<static> snakeCase(str)

Convert a string to snake case, 'foo_bar'

Parameters:
Name Type Description
str String
Source:
string/snakeCase.js
Returns:
Type
String

<static> template(str, values [, settings])

Interpolate values

Parameters:
Name Type Argument Description
str String
values Object
settings Object <optional>

Template settings, https://lodash.com/docs/4.17.15#template

Source:
string/template.js
Returns:
Type
String

<static> unquote(str [, unescape] [, quoteSet])

Unquote a string

Parameters:
Name Type Argument Default Description
str String
unescape boolean <optional>
false

True to unescape slashed quote, default false

quoteSet Set | Array <optional>

Set of chars

Source:
string/unquote.js
Returns:
Type
String

<static> urlAppendQuery(url, query)

Merge the query parameters into given url.

Parameters:
Name Type Description
url String

Original url.

query Object

Key-value pairs query object to be merged into the url.

Source:
string/urlAppendQuery.js
Returns:
Type
String

<static> urlJoin(base, extraPath, more)

Join base url and the extra url path.

Parameters:
Name Type Argument Description
base String
extraPath String
more any <repeatable>

More path

Source:
string/urlJoin.js
Returns:
Type
String

<static> urlObjectToQueryString(obj)

Stringify an object into url query string.

Parameters:
Name Type Description
obj Object
Source:
string/urlObjectToQueryString.js
Returns:
Type
String

<static> urlQueryStringToObject(qs)

Parse query string into key-value pairs.

Parameters:
Name Type Description
qs String
Source:
string/urlQueryStringToObject.js
Returns:
Type
Object