Regular Expression Problem
A small example of the problem I have:
test another test
In this string, I want to replace (say by empty string) but ONLY when there is just a single occurrence. For example, this is the desired output for teh previous string:
Is there a regular expression that could be used in the replace method that could accomplish this? I have tried with several expressions with no success but I am no expert in regular expressions.
If this can not be done usign a regular expression, what would be the most efficient way of accomplishing this? Using the indexOf method?
Thanks in advance for your help.