NSString的內容來自一個URL,我希望添加一些字符串到裡面。而且這個NSString會實時改變。
比如:
獲取的數據是:" hi mac this is ios"
然後字符串就會改變為:" hi ios this mac" or hi this is mac ios"
在mac
後面就加上hello
:變成這樣:
" hi mac hello this is ios"
" hi ios this mac hello"
"hi this is mac hello ios"
該如何實現?
string = [string stringByReplacingOccurrencesOfString:@"Mac" withString:@"Mac Hello"];