iPhone/Objective-C 或 SQL - 从大写到小写的字符串操作
我有很多数据都是大写的。
将数据转换为小写字符串的最简单方法是什么?
例如,数据:“MEDIUM BIG MAC & FRIES $1.95”转换为“Medium Big Mac & Fries $1.95”
其他示例数据可能包含“350ML”,我想将其转换为“350ml”。所以是的,数据也包含数值。
我知道我可以使用: [string CapitalizedString];
但是是否有某种方便的方法或库来处理正确的英语语法?
否则,作为完整的替代方案,数据位于 SQL Server 中。将数据库中的所有数据转换为大写字符串会更好吗?如果是这样,最好的方法是什么?也许是 UDF 或特定的 UPDATE 查询?
I have a whole lot of data that's all in uppercase.
What would be the easiest way to convert that data into lowercase strings?
e.g., data: "MEDIUM BIG MAC & FRIES $1.95" into "Medium Big Mac & Fries $1.95"
Other example data may contain "350ML", which I'd like converted into "350ml". So yes, the data contains numerical values as well.
I'm aware that I can use: [string capitalizedString];
but is there some sort of convenience method or library to handle proper English grammar?
Otherwise as a complete alternative, the data is in SQL Server. Would I be better off converting all the data in the database to capitalizedStrings? If so, what would be the best way of doing that? Perhaps a UDF or specific UPDATE query?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Obj-C:
[字符串大写字符串];
SQL:
Obj-C:
[string capitalizedString];
SQL: