Strings (dw::core::Strings) Flashcards

1
Q

appendIfMissing

A

Appends the suffix to the end of the text if the text does not already ends with the suffix.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

camelize

A

Returns a string in camel case based on underscores in the string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

capitalize

A

Capitalizes the first letter of each word in a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

charCode

A

Returns the Unicode for the first character in an input string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

charCodeAt

A

Returns the Unicode for a character at the specified index.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

collapse

A

Collapses the string into substrings of equal characters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

countCharactersBy

A

Counts the number of times an expression that iterates through each character in a string returns true.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

countMatches

A

Counts the number of matches in a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

dasherize

A

Replaces spaces, underscores, and camel-casing in a string with dashes (hyphens).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

everyCharacter

A

Checks whether a condition is valid for every character in a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

first

A

Returns characters from the beginning of a string to the specified number of characters in the string, for example, the first two characters of a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

fromCharCode

A

Returns a character that matches the specified Unicode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

hammingDistance

A

Returns the Hamming distance between two strings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

isAlpha

A

Checks if the text contains only Unicode digits. A decimal point is not a Unicode digit and returns false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

isAlphanumeric

A

Checks if the text contains only Unicode letters or digits.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

isLowerCase

A

Checks if the text contains only lowercase characters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

isNumeric

A

Checks if the text contains only Unicode digits.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

isUpperCase

A

Checks if the text contains only uppercase characters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

isWhitespace

A

Checks if the text contains only whitespace.

20
Q

last

A

Returns characters from the end of string to a specified number of characters, for example, the last two characters of a string.

21
Q

leftPad

A

The specified text is left-padded to the size using the padText. By default padText is “ “.

22
Q

levenshteinDistance

A

Returns the Levenshtein distance (or edit distance) between two strings.

23
Q

lines

A

Returns an array of lines from a string.

24
Q

mapString

A

Applies an expression to every character of a string.

25
Q

ordinalize

A

Returns a number as an ordinal, such as 1st or 2nd.

26
Q

pluralize

A

Pluralizes a singular string.

27
Q

prependIfMissing

A

Prepends the prefix to the beginning of the string if the text does not already start with that prefix.

28
Q

remove

A

Removes all occurrences of a specified pattern from a string.

29
Q

repeat

A

Repeats a text the number of specified times.

30
Q

replaceAll

A

Replaces all substrings that match a literal search string with a specified replacement string.

31
Q

reverse

A

Reverses sequence of characters in a string.

32
Q

rightPad

A

The specified text is right-padded to the size using the padText. By default padText is “ “.

33
Q

singularize

A

Converts a plural string to its singular form.

34
Q

someCharacter

A

Checks whether a condition is valid for at least one of the characters or blank spaces in a string.

35
Q

substring

A

Returns a substring that spans from the character at the specified from index to the last character before the until index.

36
Q

substringAfter

A

Gets the substring after the first occurrence of a separator. The separator is not returned.

37
Q

substringAfterLast

A

Gets the substring after the last occurrence of a separator. The separator is not returned.

38
Q

substringBefore

A

Gets the substring before the first occurrence of a separator. The separator is not returned.

39
Q

substringBeforeLast

A

Gets the substring before the last occurrence of a separator. The separator is not returned.

40
Q

substringBy

A

Splits a string at each character where the predicate expression returns true.

41
Q

substringEvery

A

Splits a string into an array of substrings equal to a specified length.

42
Q

underscore

A

Replaces hyphens, spaces, and camel-casing in a string with underscores.

43
Q

unwrap

A

Unwraps a given text from a wrapper text.

44
Q

withMaxSize

A

Checks that the string length is no larger than the specified maxLength. If the string’s length is larger than the maxLength, the function cuts characters from left to right, until the string length meets the length limit.

45
Q

words

A

Returns an array of words from a string.

46
Q

wrapIfMissing

A

Wraps text with wrapper if that wrapper is missing from the start or end of the given string.