- Source:
- string/text.js
Methods
-
<static> bin2Hex(bin)
-
Bin to hex, like 0x7F
Parameters:
Name Type Description bin
Buffer - Source:
- string/bin2Hex.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> 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.replaceAllParameters:
Name Type Description str
String search
String replacement
String - Source:
- string/replaceAll.js
- See:
-
<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