Back to Functions

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