Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting & to & in Objective-C [duplicate]

Tags:

I have a URL string in the following format.

http://myserver.com/_layouts/feed.aspx?xsl=4&web=%2F&page=dda3fd10-c776-4d69-8c55-2f1c74b343e2&wp=476f174a-82df-4611-a3df-e13255d97533

I want to replace & with & in the above URL. My result should be:

http://myserver.com/_layouts/feed.aspx?xsl=4&web=%2F&page=dda3fd10-c776-4d69-8c55-2f1c74b343e2&wp=476f174a-82df-4611-a3df-e13255d97533

Can someone post me the code to get this done?

Thanks

like image 227
nbojja Avatar asked Jul 01 '09 07:07

nbojja


People also ask

What is the synonym of converting?

Some common synonyms of convert are metamorphose, transfigure, transform, transmogrify, and transmute. While all these words mean "to change a thing into a different thing," convert implies a change fitting something for a new or different use or function.

What is an example for convert?

An example of convert is when you convince someone to change from Catholic to Protestant. An example of convert is when you exchange dollars into Euros. An example of convert is when you change your religion from Catholic to Protestant.

Has been converted Meaning?

converted adjective (CHANGED)having changed in form or character, or been made suitable for a different use: Their homes are converted shipping containers. More examples.

Does convert mean change?

Think of the word convert as meaning "change," whether it is a person who adopts a new belief, or a changing action, such as when you convert dollars into euros.


1 Answers

Check out my NSString category for HTML. Here are the methods available:

// Strips HTML tags & comments, removes extra whitespace and decodes HTML character entities. - (NSString *)stringByConvertingHTMLToPlainText;  // Decode all HTML entities using GTM. - (NSString *)stringByDecodingHTMLEntities;  // Encode all HTML entities using GTM. - (NSString *)stringByEncodingHTMLEntities;  // Minimal unicode encoding will only cover characters from table // A.2.2 of http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Special_characters // which is what you want for a unicode encoded webpage. - (NSString *)stringByEncodingHTMLEntities:(BOOL)isUnicode;  // Replace newlines with <br /> tags. - (NSString *)stringWithNewLinesAsBRs;  // Remove newlines and white space from string. - (NSString *)stringByRemovingNewLinesAndWhitespace; 
like image 92
Michael Waterfall Avatar answered Sep 25 '22 02:09

Michael Waterfall