String Problem
I have a string(s1) which I want to tag. I also have a list of
strings(validstr) which I call valid strings. The tagging should occur if a substring in s1 matches one or all of the validstr.
The tag should be place in the match string.
Example:
<s1>Name1 and Name3 also Name4 Name5 but not Name2</s1>
validstr = (Name1, Name2, Name4 Name5)
output should be:
<s1>
<name1>Name1</name1> and <name3>Name3</name3> also
<name4name5>Name4 Name5</name4name5> but not Name2
</s1>
is there a way I can do this? I'm trying to look for a string function that can get the value and removes the value from the string, but I can't find one. Thanks.
|