直接使用字符串的.title()方法即可。
示例代码如下:
text = "hello world" result = text.title() print(result)
输出结果为:"Hello World"
上一篇:不将字符串值转换为整数值
下一篇:不将子属性加载到内存中