我有一個很大的C#文本列表,想用作枚舉列表。 例如:視覺工作室查找並替換正則表達式,用下劃線替換空間
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
現在我想使用查找和Visual Studio中替換對話框,例如
Zone_Status_Message
Zones_Snapshot_Message
加下劃線的所有單詞,而不是空間, 我如何能實現這使用正則表達式或通配符? 這真的會爲我節省很多時間。
在此先感謝。
編輯:
單詞也可以有空格和正面和背面,由於格式不良的源文件,我從中獲取文本。所以下劃線只能在空格在2個單詞之間時加上。
謝謝,這工作! –