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
Post a Comment