Pugalmuni
Pugalmuni

Reputation: 9390

How to remove the Tags from the strings in iPhone?

I want to remove the tags from my string.

For Eg,

     NSSTring *str = @"<null>";

     My expected output is null. 

So i want to remove the HTML tags.

So please guide me.

Thanks.

         .

Upvotes: 0

Views: 301

Answers (2)

Satya
Satya

Reputation: 3330

If you want to remove the "<" and ">" symbols then you can use the following code.

string = [string stringByReplacingOccurrencesOfString:@"<" withString:@""];
string = [string stringByReplacingOccurrencesOfString:@">" withString:@""];

Upvotes: 1

EmptyStack
EmptyStack

Reputation: 51374

Try,

str = [str stringByReplacingOccurrencesOfString:@"<" withString:@""];
str = [str stringByReplacingOccurrencesOfString:@">" withString:@""];

Upvotes: 2

Related Questions