Skip to content
On this page

capitalsFirstLetter

Definition:

js
/**
 * @param str - The string to be processed.
 * @returns The string with the first letter capitalized.
 * @description Convert the first letter of the string to uppercase and return it.
**/

Demo

converted string: Hello

Usage Example

ts
import { computed, ref } from 'vue'
import { capitalsFirstLetter } from 'utils-snap-fn'

const inputVal = ref('hello')

const convertedRes = computed(() => {
  return capitalsFirstLetter(inputVal.value)
})

Source Code

utils-snap-fn-docs