开发者

iPhone/Objective-C or SQL - String manipulation from CAPS to lowercase

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 t开发者_运维百科he database to capitalizedStrings? If so, what would be the best way of doing that? Perhaps a UDF or specific UPDATE query?


Obj-C:

[string capitalizedString];

SQL:

UPDATE filteredcontact
SET firstname=UPPER(LEFT(firstname,1))+SUBSTRING(firstname,2,LEN(firstname))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜