Scenario - I retrieve two strings from a website, one is a company name and the other is company address with the name in. I want to remove the company from the address if it’s present but sometimes due to human error a there’s a spelling mistake. how can i still remove the company name if there is a spelling mistake.
Removing the company name has been working with if(string2.contains(string1 + “,”), string2.replace(string1 + “,”,“”).Trim,string2.trim) but if there’s a spelling error it doesn’t work. what can I do to fix this
Please note that this is just an example the spelling mistake could be “Jonh Doe”
String 1 = “John Doe”
String 2= “John Deo, 123 fake street, fake avenue”
expected result = “123 fake street, fake avenue”