iPhone-SDK : Remove uneccessary white spaces from big paragraph string?

标签 iphone cocoa

我想从下面提到的大段落字符串中删除不必要的空格。

我尝试通过 stringByTrimmingCharactersInSet 并使用replaceOccurrencesOfString 等删除它。没有成功。有人可以查看我的段落字符串并为我提供代码片段,该代码片段可以替换所有不必要的空格并使其值得阅读。

段落字符串从下面开始 ------------------------------------------

         World wealth down 11 pct, fewer millionaires - report 





     Top News 





 World wealth down 11 pct, fewer millionaires - report 
 11:29 AM IST 





     By Joe Rauch 

     NEW YORK (Reuters) - The 2008 global recession caused the first worldwide contraction in assets under management in nearly a decade, according to a study that found wealth dropped 11.7 percent to $92.4 trillion. 

     A return to 2007 levels of wealth will take six years, according to a Boston Consulting Group study that examined assets overseen by the asset management industry. 

     North America, particularly the United States, was the hardest hit region, reporting a 21.8 percent decline in wealth firms' assets under management to $29.3 trillion, primarily because of the beating U.S. equities investments took in 2008. 

     Also hit hard were off-shore wealth centers, like Switzerland and the Caribbean, where assets declined to $6.7 trillion in 2008 from $7.3 trillion in 2007, an 8 percent drop. 

     The downturn has "shattered confidence in a way we have not seen in a long time," said Bruce Holley, senior partner and managing director at BCG's New York office. 

     The study forecasts that wealth management firms' assets under management will not return to 2007 levels, $108.5 trillion, until 2013, a six-year rebound. 

     Europe posted a slightly higher $32.7 trillion of assets under management, edging out North America for the wealthiest region, though the total wealth in region dropped 5.8 percent. 

     Latin America was the only region to report a gain in assets under management, posting a 3 percent uptick from $2.4 trillion in 2007 to $2.5 trillion in 2008. 



     MILLIONAIRE ... NOT 

     The economy's retreat also pounded millionaires who made risky investments during the economic boom. 

     The number of millionaires worldwide shrank 17.8 percent to 9 million, the BCG study found. 

     Europe and North America were hardest hit in that regard, posting 22 percent declines. The United States still boasts 3.9 million millionaires, the highest population on the globe. 

     Singapore had the highest density of millionaires at 8.5 percent of the population. Other countries included Switzerland, at 6.6 percent, Kuwait, at 5.1 percent, United Arab Emirates, at 4.5 percent, and the United States, at 3.5 percent. 

----------------- 段落字符串在上方结束 ------------------------- -----------

最佳答案

请参阅我对您之前相同问题的回答:

iPhone-SDK:Remove white spaces from a paragraph string?

关于iPhone-SDK : Remove uneccessary white spaces from big paragraph string?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1426331/

相关文章:

iPhone Developer' 与任何有效的、未过期的证书/私钥对不匹配 - 但我正在创建 iPad 应用程序

iphone - 如何使手势识别器在动画 UIImage View 中工作

iphone - 如何找到ios中对象被释放的位置

objective-c - 使用 NSRegularExpression 命名捕获组

ios - App Thinning - 如果开发人员未提供所有 Assets ,它是如何工作的

iphone - iOS 7 对文本应用字距调整和行距

iphone - 如何动态地将 UIButton 添加到 UITableViewCell?

swift - Cocoa SCNetworkInterface 获取媒体子类型

objective-c - 展平一个 NSArray

ios - 如何将相同的 UNNotificationContentExtension 与不同的 UNNotificationAction 一起使用?