String

Namespace

String

Source:

Methods

capitaliseFirstLetter(loweropt) → {string}

Description:
  • Returns string with capitalised first letter
Source:
Parameters:
Name Type Attributes Default Description
lower boolean <optional>
false Flag if it should lower all letters first
Returns:
New string
Type
string

includes(search, startopt) → {boolean}

Description:
  • Polyfill for ECMAScript 2015 for String.prototype.includes
Source:
Parameters:
Name Type Attributes Default Description
search string Search for
start number <optional>
0 Searching start position
Returns:
Verdict
Type
boolean

isLike(query) → {boolean}

Description:
  • Check if string is like given query (you can use regexp notation)
Source:
Parameters:
Name Type Description
query string Query
Returns:
Verdict
Type
boolean

lowerFirstLetter() → {string}

Description:
  • Returns string with lower first letter
Source:
Returns:
New string
Type
string

noCase() → {string}

Description:
  • Returns string with removed cases
Source:
Returns:
New string
Type
string

reverse() → {string}

Description:
  • Returns reversed string
Source:
Returns:
Reversed string
Type
string

toBoolean() → {boolean}

Description:
  • Returns string in boolean
Source:
Returns:
True if string looks somehow like 'true'
Type
boolean

toCamelCase() → {string}

Description:
  • Returns string in camelCase
Source:
Returns:
String in camelCase
Type
string

toChecksum() → {string}

Description:
  • Returns checksum crc32
Source:
Author:
  • joelpt
  • schnaader
See:
Returns:
Checksum
Type
string

toKebabCase() → {string}

Description:
  • Returns string in kebab-case
Source:
Returns:
String in kebab-case
Type
string

toPascalCase() → {string}

Description:
  • Returns string in PascalCase
Source:
Returns:
String in PascalCase
Type
string

toSnakeCase(convertToUpperCaseopt) → {string}

Description:
  • Returns string in snake_case
Source:
Parameters:
Name Type Attributes Default Description
convertToUpperCase boolean <optional>
false Set this flag to convert to UpperCase
Returns:
String in snake_case
Type
string

(static) editDistance(a, b) → {number}

Description:
  • Calculate edit distance between string a and b
Source:
See:
Parameters:
Name Type Description
a string A
b string B
Returns:
Distance
Type
number

(static) getSimilarity(a, b) → {number}

Description:
  • Get similarity ratio based on edit distance
Source:
See:
Parameters:
Name Type Description
a string A
b string B
Returns:
Ratio
Type
number

(static) isEmpty(sth) → {boolean}

Description:
  • Checks is given value is String and is empty
Source:
Parameters:
Name Type Description
sth string Something to check
Returns:
Verdict
Type
boolean

(static) isInvalidOrEmpty(sth) → {boolean}

Description:
  • Checks is given value isn't a String, or it is empty
Source:
Parameters:
Name Type Description
sth string Something to check
Returns:
Verdict
Type
boolean

(static) isNotEmpty(sth) → {boolean}

Description:
  • Checks is given value is String and is not empty
Source:
Parameters:
Name Type Description
sth string Something to check
Returns:
Verdict
Type
boolean