-3

I have a NSString:

NSString *string1 = @"http://example.com/this-is-an-example-post"

By removing a range of characteres I have substringed it to:

NSString *string2 = @"this-is-an-example-post"

But I am struggling to get it into the form of:

NSString *string3 = @"this is an example post"

Any help? Much appreciated.

Cescy
  • 1,921
  • 3
  • 18
  • 21

1 Answers1

5

For example this way

string3 = [string2 stringByReplacingOccurrencesOfString:@"-" withString:@" "];
nerowolfe
  • 4,787
  • 3
  • 20
  • 19
  • 2
    @CescSergey: Probably because a simple lookup of the NSString documentation would have solved your problem. – Martin R Apr 24 '14 at 08:15