close

螢幕快照 2015 04 22 下午11 35 19

 

 

 

 

 

從網頁中抓到的字串頭尾有很多的\r\n\t,該怎麼trim掉呢

NSString *trimmedString = [stockInfoString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

//這個只去掉頭尾的\t
//NSString *trimmedString = [stockInfoString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];

來源:http://stackoverflow.com/questions/4683235/how-to-remove-remove-n-t-from-string-in-iphone

arrow
arrow
    全站熱搜

    Kirk 發表在 痞客邦 留言(0) 人氣()