在Python中将大写字符串转换为句子格式

15 浏览
0 Comments

在Python中将大写字符串转换为句子格式

如何将大写字符串转换为正确的句子大小写?示例字符串:

"OPERATOR FAIL TO PROPERLY REMOVE SOLID WASTE"

使用titlecase(str)会给我:

"Operator Fail to Properly Remove Solid Waste"

我需要的是:

"Operator fail to properly remove solid waste"

有没有简单的方法可以做到这一点?

0