toLower
string
Converts string, as a whole, to lower case.
Installation
Import
import { toLower } from '@tulx/utils';Source Code
Implementation
/**
* Converts string, as a whole, to lower case.
*
* @param string - The string to convert.
* @returns Returns the lower cased string.
*
* @example
* ```ts
* toLower('--Foo-Bar--'); // '--foo-bar--'
* toLower('fooBar'); // 'foobar'
* toLower('__FOO_BAR__'); // '__foo_bar__'
* ```
*/
export function toLower(string: string): string {
return string.toLowerCase();
}
Example
import { toLower } from '@tulx/utils';
toLower('--Foo-Bar--'); // '--foo-bar--'
toLower('fooBar'); // 'foobar'
toLower('__FOO_BAR__'); // '__foo_bar__'Related Functions
camelCase
Converts string to camel case.
capitalize
Converts the first character of string to upper case and the remaining to lower case.
deburr
Deburrs string by converting Latin-1 Supplement and Latin Extended-A letters to basic Latin letters and removing combining diacritical marks.
endsWith
Checks if string ends with the given target string.
escape
Converts the characters "&", "<", ">", '"', and "'" in string to their corresponding HTML entities.
escapeRegExp
Escapes the RegExp special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in string.