Skip to content

capitalize() function

str의 첫 문자를 대문자로, 나머지 문자를 소문자로 변환합니다.

Signature:

typescript
function capitalize(str: string): string;

Example

ts
capitalize("fred"); // "Fred"
capitalize("FRED"); // "Fred"
capitalize(""); // ""

Open Source Code

Released under the Apache-2.0 License.