if anyone can help me with this one…
I have a string named text. I need to ensure that after every occurrence of a specific character ” there is a whitespace. If there is not a whitespace, then I need to insert one.
I am not sure on the best approach to accomplish this in c#, I think regular expressions may be the way to go, but I do not have enough knowledge about regular expressions to do this…
If anyone can help it would be appreciated.
The regular expression a(?!\s) searches for ‘a’ that is not followed by a whitespace. The lambda expression x=>x + ” ” tells the replace function to replace any occurence of ‘a’ without a following whitespace for ‘a’ with a whitespace