I need to extract a string from a string. Only trouble is working out how to specifically in my case.
Lets say this is the master string:
City = My City;
Street = My Street 1\nMy Street 2;
So, I would want to extract these three things separately:
My City, My Street 1 and My Street 2.
So I how would I do so?
You can use componentsSeparatedByString:<#(NSString *)#> method of the String, it will give you Array of Split Strings.
In your case, Do
At [array objectAtIndex:2] you will find “My Street 1\nMy Street 2;” (considering String starts as “My Street 1\nMy Street 2;”)
Then you can again Split them by <#(NSString *)#> in your case @”\n”