MCPcopy Create free account
hub / github.com/Effect-TS/effect / capitalize

Function capitalize

packages/effect/src/String.ts:206–210  ·  view source on GitHub ↗
(self: T)

Source from the content-addressed store, hash-verified

204 * @since 2.0.0
205 */
206export const capitalize = <T extends string>(self: T): Capitalize<T> => {
207 if (self.length === 0) return self as Capitalize<T>
208
209 return (toUpperCase(self[0]) + self.slice(1)) as Capitalize<T>
210}
211
212/**
213 * Uncapitalizes the first character of a string.

Callers

nothing calls this directly

Calls 1

toUpperCaseFunction · 0.70

Tested by

no test coverage detected