iphone - how to remove a particular sign from a string? -


i have string

gpbusd~buy~~~~update~hit 40 pips~hit 110 pips~~gpbusd~buy~~~break even~update~hit~100+~~gpbusd~buy~1.5500/25~1.5455~~new~40~100+~~gpbusd~buy~~~~update~close 0 10 pips n~~~gpbusd~buy~1.5335/50~1.5320~~new~40~80+~~gpbusd~buy~~~~update~~15-20 pips close~keep open~gpbusd~buy~1.5530/50~~1.5505~update~hit~80~keep open~gpbusd~buy~1.5530/50~1.5465~~new~40~80~100+~gbpjpy~sell~131.05/.130.75~132.15~~new~60~100~keep open~eurusd~sell~1.2840/20~1.2870~stop~update~~~~

i want remove delimeter sign , separate words between them ?how can it?

  • splitting string:

    nsarray *parts = [string componentsseparatedbystring: @"~"]; 
  • assembling string array:

    nsstring *string = [parts componentsjoinedbystring: @" "]; 
  • sanitizing string, replacing occurences of ~ whitespace:

    nsstring *string = [string stringbyreplacingoccurrencesofstring: @"~"\                            withstring:@" " ] 

Comments

Popular posts from this blog

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -

openssl - Load PKCS#8 binary key into Ruby -