Title

Global

Methods

# camelcase(string) → {String}

Returns a string in camelcase after trimming it

Parameters:
Name Type Description
string String

View Source camelcase/camelcase.ts, line 4

The camelcase string

String
Examples
camelcase(' This is a tesT ')
// thisIsATest
str(' This is a tesT ').camelcase().value
// thisIsATest

# capitalize(str) → {String}

Capitalizes a string after applying a trim to it

Parameters:
Name Type Description
str String

View Source capitalize/capitalize.ts, line 3

String
Examples
capitalize('test')
// Test
str('TEST').capitalize()
// Test

# count(str) → {Number}

Counts characters in a string

Parameters:
Name Type Description
str String

View Source count/count.ts, line 2

Number of characters

Number
Examples
count('test')
// 4
str('test').length
// 4
str('test').count()
// 4

# endsWith(str, substring, posopt) → {Boolean}

Checks if a string ends with the provided substring

Parameters:
Name Type Attributes Default Description
str String
substring String
pos Number <optional>
0

Position to start checking. Defaults to 0

View Source endsWith/endsWith.ts, line 2

True / False

Boolean
Examples
endsWith('test', 'st')
// true
str('test').endsWith('st')
// true

# lower(str) → {String}

Transform str to lower case

Parameters:
Name Type Description
str String

View Source lower/lower.ts, line 2

Lower cased string

String
Examples
lower('TEST')
// test
str('TEST').lower().value
// test

# slugify(str, delopt) → {String}

Slugifies a string

Parameters:
Name Type Attributes Default Description
str String
del String <optional>
-

Delimiter, defaults to '-'

View Source slugify/slugify.ts, line 3

Slugified string

String
Examples
slugify(' This is a tesT ')
// this-is-a-test
slugify(' This is a tesT ', ':')
// this:is:a:test
str(' This is a tesT ').slugify().value
// this-is-a-test

# startsWith(str, substring, posopt) → {Boolean}

Checks if a string starts with the provided substring

Parameters:
Name Type Attributes Default Description
str String
substring String
pos Number <optional>
0

Position to start checking. Defaults to 0

View Source startsWith/startsWith.ts, line 2

True / False

Boolean
Examples
startsWith('test', 'te')
// true
str('test').startsWith('te')
// true

# trim(str) → {String}

Trims a string by the right and by the left

Parameters:
Name Type Description
str String

View Source trim/trim.ts, line 2

Trimmed string

String
Examples
trim(' This is a tesT ')
// This is a tesT
str(' This is a tesT ').trim().value
// This is a tesT

# upper(str) → {String}

Transform a string to uppercase

Parameters:
Name Type Description
str String

View Source upper/upper.ts, line 2

Uppercased string

String
Examples
upper('test')
// TEST
str('test').upper().value
// TEST