capitalize

Capitalize the first character of s and convert the rest of s to lowercase.

@trusted pure
S
capitalize
(
S
)
()

Parameters

input S

The string to capitalize.

Return Value

Type: S

The capitalized string.

Examples

assert(capitalize("hello") == "Hello");
assert(capitalize("World") == "World");

See Also

std.uni.asCapitalized for a lazy range version that doesn't allocate memory

Meta