I have a large list of text in c# that in want to use as an enum list. For example:
Zone Status Message
Zones Snapshot Message
Partition Status Message
Partitions Snapshot Message
Supported transition message flags
System Status Message
X-10 Message Received
Log Event Message
Keypad Message Received
Now I want to use the find and replace dialog in visual studio to add underscores in all the words instead of a space, for example
Zone_Status_Message
Zones_Snapshot_Message
How can I achieve this using regex or wildcard? This would really save me a lot of time.
Thanks in advance.
EDIT:
The words can also have spaces and the front and back, due to a poorly formatted source document where I get the text from. So the underscore should only be added when the space is between 2 words.