함수 title()

1 개요[ | ]

함수 title()

2 Go[ | ]

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("хлеб"))               // Хлеб
}

3 Python[ | ]

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())               # Хлеб

4 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}