I have some problems and need some help with Objective-C.
I'm trying to find a String, let's say it is called <font>
in a XML File and within the Tag I want to replace a word in a sentence.
Something like this
<body>
...
<font>Let's do a quick test</font>
...
</body>
For example:
Between <font>
and </font>
I want to replace the word quick
to good
.
And those changes has to overwrite the XML-File.
If someone can help me please let me know.
Thank you
Firstly get the string between two string using this method
-
Now str1 contains @"Let's do a quick test" then replace the word quick to good
There are some more methods provided by Apple which help you to replace with more options
/* Replace all occurrences of the target string in the specified range with replacement. Specified compare options are used for matching target. If NSRegularExpressionSearch is specified, the replacement is treated as a template, as in the corresponding NSRegularExpression methods, and no other options can apply except NSCaseInsensitiveSearch and NSAnchoredSearch. */
/* Replace all occurrences of the target string with replacement. Invokes the above method with 0 options and range of the whole string. */
/* Replace characters in range with the specified string, returning new string. */
................................<><><><><><><>...........................
Thanks, Hope this helps you.