I need to get rid of apostrophes, in case there’s one, to populate a field. The case is: I store last names in a variable, then, I put the that variable/ lastName on a online form. The issue is that the form doesn’t take any special characters like O’hare.
If recommendation of how to get rid of the apostrophe or any special characters when I use the type in activity? Or any other solution?
Thank you! You guys pointed me on the right direction. However I’m running into the issue that besides the last names with apostrophes, I also need to clean the last names with “-“
My code is:
LastName.Replace(“ ‘ “, “ “).ToString this works great but when I add:
You can chain the .Replace method on. So it would be
LastName.Replace(“ ‘ “, “ “).Replace(“ - “, “ “)
You can just keep adding .Replace at the end with whatever you need. It will work from left to right though, so keep that in mind (i.e. all ’ characters will be replaced first, then - characters will get replaced second). Also note that .ToString isn’t needed because it is already of type string