For example. I have string value like this :
var str = "asdImverygreatfullasdandeverythingwillbegoodandIwillbehappy"
there is ‘asd’ and ‘and’ these two words repeat between sentences. I want to find these two words and remove from str. Is that possible?
Desire output will be :
str = "ImverygreatfulleverythingwillbegoodIwillbehappy"
2
Answers
You can do something like this : –
Your Answer will be
An efficient way is to replace the substrings with help of Regular Expression
"a(s|n)d"
means find both"asd"
and"and"