I am using:
underscoredWord = Regex.Replace(word, "[^" + correctLetters + "]", " _");
for my Hangman game. It basically chops the word up and replaces all the text with an underscore.
This works fine if the guessing word is only "one word". So the word: "Building" will get converted to: _ _ _ _ _ _ _ _
How do I improve the above Regex express so that it puts underscores for all letters and a forward slash "/" for spaces?
So the words: Hello Batman
Be turned in to: _ _ _ _ / _ _ _ _ _
Any and all ideas/contributions to this post will be highly appreciated.