Link Search Menu Expand Document

Strings

strings.ts#L59

autoCorrect (word: string, dict: Array<string>): undefined|string

Tries to auto-correct a word from a dictionary.

Name Type Default Description
word string    
dict Array<string>    
strings.ts#L31

isPalindrome (str: string): boolean

Checks if a string is a palindrome.

Name Type Default Description
str string    
strings.ts#L40

stringDistance (s1: string, s2: string, ignoreTrailing: boolean): number

Determines the Levenshtein distance between two strings. If ignoreTrailing is true, we will ignore any additional, trailing characters in s2.

Name Type Default Description
s1 string    
s2 string    
ignoreTrailing boolean false  
strings.ts#L24

toCamelCase (str: string): string

Converts a string to camel case.

Name Type Default Description
str string    
strings.ts#L18

toTitleCase (str: string): string

Converts a string to title case.

Name Type Default Description
str string    
strings.ts#L11

words (str: string, divider: RegExp): Array<string>

Splits a string into space separated words.

Name Type Default Description
str string    
divider RegExp  

Copyright © 2021 Mathigon.org