iPhone-SDK:从大段落字符串中删除不必要的空格?

时间:2009-09-15 10:29:53

标签: iphone cocoa

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

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

Paragraphs String从下面开始------------------------------------------

         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. 

-----------------段落字符串结束于------------------------- -----------

1 个答案:

答案 0 :(得分:2)

请参阅我之前相同问题的答案:

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