Global Helpers
capitalize()
Signature
Section titled “Signature”capitalize() — returns string
Available in: controller, model, mapper, migrator, migration, tabledefinition
Category: String Functions
Description
Section titled “Description”Capitalizes the first character of the supplied string.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | yes | — | String to capitalize. |
Examples
Section titled “Examples”// 1. Capitalize the first character of a sentence
result = capitalize("wheels is a framework");
// result -> "Wheels is a framework"
// 2. Capitalize a lowercase word
result = capitalize("hello");
// result -> "Hello"
// 3. Returns an already-capitalized string unchanged
result = capitalize("CFWheels");
// result -> "CFWheels"