ts-utils
  • Getting Started
  • Contributing
  • Testing
  • Functions
    • Array Methods
      • isArr
      • isArrEmpty
      • pushUniqueValue
      • pushOrUpdate
    • Date Methods
      • toNow
      • formatDate
      • fromNow
    • Number Methods
      • toFixed
      • parseNumber
      • parseFormat
      • addUnit
      • addSeparators
      • formatNumber
      • ensureNumber
      • numberEmptyState
    • Object Methods
      • parseJSON
      • deepClone
      • parseNumValues
      • removeEmptyKeys
      • sanitizeQuery
      • removeKeys
      • renameKey
      • renameKeys
      • sortByKeyLength
      • querylize
      • parseNumericObj
      • reserveKeys
      • hasKeysAndValues
    • String Methods
      • randomStr
      • toUpperCase
      • toLowerCase
      • toFullUrl
      • initials
      • generateUuid
Powered by GitBook
On this page
  • toUpperCase(str)
  • Arguments
  • Returns
  • Example
  • Usage
  • Notes

Was this helpful?

  1. Functions
  2. String Methods

toUpperCase

toUpperCase(str)

Converts a string to uppercase. This function is a simple wrapper around the built-in toUpperCase() method of the String object.

Arguments

  • str (string): The input string to convert to uppercase.

Returns

  • string: The input string converted to uppercase.

Example

typescript
import { toUpperCase } from 'check-engineering/ts-utils';

const originalString = "Hello, World!";
const uppercaseString = toUpperCase(originalString); // => "HELLO, WORLD!"

Usage

typescript
import { toUpperCase } from 'check-engineering/ts-utils';

const message = "this is a message";
const capitalizedMessage = toUpperCase(message); // => "THIS IS A MESSAGE"

Notes

  • The toUpperCase function is a simple utility function that converts a string to uppercase.

  • It is a convenient way to ensure that a string is in uppercase format without having to call the toUpperCase() method directly.

  • This function can be useful in scenarios where you need to standardize the case of strings, such as when comparing or sorting strings.

PreviousrandomStrNexttoLowerCase

Last updated 11 months ago

Was this helpful?