发布于 4年前

Python使用标题格式(首字母大写)

以下代码段可用于将字符串转换为标题大小写。这是使用字符串类的title()方法完成的。

my_string = "my name is chaitanya baweja"
# using the title() function of string class
new_string = my_string.title()
print(new_string)
# Output
# My Name Is Chaitanya Baweja
©2020 edoou.com   京ICP备16001874号-3