toLowerAt

Converts the character at the specified index in the input string to lowercase.

Usage Scenarios

  • Text Correction: In text editing, correct the case of a specific character.
  • Data Normalization: Standardize the case of characters in a string.

Example

import { toLowerAt } from 'funtool/string'

toLowerAt('Hello', 0) // ✅ 'hello'
toLowerAt('Foo-Bar', 'B') // ✅ 'Foo-bar'

Signature

function toLowerAt(input: string, target: string | number): string

Parameters

  • input ( string ): The input string.
  • target ( string | number ): The index of the character to convert to lowercase.

Returns

  • ( string ): A new string with the character at the specified index lowercased.