Standard library / strings

strings.Title()

Deprecated word-title transformation; its word boundary rule does not handle Unicode punctuation correctly. Prefer a verified Unicode-aware casing library for word titles. Expected stdout: 'Hello World\n'.

Formal Syntax & Structure

go syntaxgo
func Title(s string) string

Parameters & Attributes

NameTypeDescription
sstringInput text or sequence.

Return Value

string

Deprecated word-title transformation; its word boundary rule does not handle Unicode punctuation correctly. Prefer a verified Unicode-aware casing library for word titles.

Working Example

Example Snippetgo
package main
import (  "fmt"  "strings")
func main() {  fmt.Println(string(strings.Title("hello world")))}
Go Reference