문제

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.

도움이 되었습니까?

해결책

For example this way

string3 = [string2 stringByReplacingOccurrencesOfString:@"-" withString:@" "];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top