mercredi 13 mai 2020

Replacing spaces in a string with a word in a random fashion c#

I am trying to figure out how to replace a space found in a string with the word "car", but I want it to replace it in a random order, like only some of the spaces would be replaces with "car" for example:

Input: "Hi welcome to the autobody shop how can I help you today?" Output: "Hi car welcome to car autobody shop how car I help car you today?"

As you see, only some spaces have been replaced with the word "car". I hope someone could help me with this, thank you.




Aucun commentaire:

Enregistrer un commentaire