toUpperCase

Converts all characters in the str to uppercase.

Usage Scenarios

  • Text Emphasis: In text processing, emphasize text by converting it to uppercase.
  • Data Standardization: Standardize the case of strings for comparison.

Example

import { toUpperCase } from 'funtool/string'

toUpperCase('hello') // => 'HELLO' ✅
toUpperCase(123) // => '123' ✅

Signature

function toUpperCase(str: string): string

Parameters

  • str ( string ): The input string.

Returns

  • ( string ): A new string with all characters in uppercase.