함수 title()

1 개요[ | ]

함수 title()

2 Go[ | ]

Go
Copy
package main

import (
	"fmt"

	"golang.org/x/text/cases"
	"golang.org/x/text/language"
)

func main() {
	caser := cases.Title(language.English)

	fmt.Println(caser.String("FooBar")) // Foobar

	fmt.Println(caser.String("hello world!"))       // Hello World!
	fmt.Println(caser.String("i with dot"))         // I With Dot
	fmt.Println(caser.String("'n ijsberg"))         // 'N Ijsberg
	fmt.Println(caser.String("here comes O'Brian")) // Here Comes O'brian

	fmt.Println(caser.String("her royal highness")) // Her Royal Highness
	fmt.Println(caser.String("loud noises"))        // Loud Noises
	fmt.Println(caser.String("хлеб"))               // Хлеб
}
Loading

3 Python[ | ]

Python
Copy
print("FooBar".title()) # Foobar

print("hello world!".title())       # Hello World!
print("i with dot".title())         # I With Dot
print("'n ijsberg".title())         # 'N Ijsberg
print("here comes O'Brian".title()) # Here Comes O'Brian

print("her royal highness".title()) # Her Royal Highness
print("loud noises".title())        # Loud Noises
print("хлеб".title())               # Хлеб
Loading

4 같이 보기[ | ]