i want to replace a string in a string. let me explain you what my exacvt aim is.
This ist my String
<p>Hello Webseite i want to replace<p>thisPTag</p>which is in the middle
of the word or in the end of the sentence</p>.
If i use
[string stringByReplacingOccurrencesOfString:@"<p>" withString:@"|break|"];
it replaces only the first
. But i want to replace ALL p tags, doesnt matter if in the sentence or not, white space before or after that also doesnt matter.
So how can i do that?
Not really important but good to know:
please keep in mind that i dont want to strip html, i just want to replace the p-tag to set breaks there for correct SSML and TTS(textto speech)
It works (all
<p>are replaced). You probably just confusing<p>and</p>. These are different literals, so they would have to be replaced separately:This prints: