Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/string/index.ts>capitalize

A JavaScript extension package for building strong and modern applications.
Latest
function capitalize
import { capitalize } from "https://deno.land/x/ayonli_jsext@v0.9.72/string/index.ts";

Capitalizes the string, if all is true, all words are capitalized, otherwise only the first word will be capitalized.

Examples

Example 1

import { capitalize } from "@ayonli/jsext/string";

console.log(capitalize("hello world")); // Hello world
console.log(capitalize("hello world", true)); // Hello World

Parameters

str: string
optional
all: boolean

Returns

string