是否有函数可以将字符串中的每个单词大写,或者这是一个手动过程?
例如“鲍勃很高” 我想要“Bob Is Tall”
肯定有一些东西,但我发现的 Swift IOS 答案似乎都没有涵盖这一点。
最佳答案
Discussion
A string with the first character in each word changed to its corresponding uppercase value, and all remaining characters set to their corresponding lowercase values.
和/或capitalizedStringWithLocale(_:)
Returns a capitalized representation of the receiver using the specified locale.
For strings presented to users, pass the current locale ([NSLocale currentLocale]). To use the system locale, pass nil.
关于ios - 如何使用 Swift iOS 将字符串中的每个单词大写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29261218/