I notice the files I am importing in had inconsistent dashes, one dash is longer than the order, I want to make all dashes consistent,
I know you can use regex.replace
code = Regex.Replace( code, " something", '-')
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Apr 5, 2012, 12:46 PM
code = Regex.Replace( code, @"(\u2013|\u2014)", "-" );
David SmithPosted Apr 5, 2012, 12:40 PM
VulpesPosted Apr 5, 2012, 10:34 AM
Sam HobbsPosted Apr 5, 2012, 9:27 AM
VulpesPosted Apr 5, 2012, 6:09 AM
However, AFAIK, '\u' followed by the hex codepoint is the only way to numerically express a character outside the ASCII range in .NET regular expressions.
Sam HobbsPosted Apr 4, 2012, 7:14 PM
VulpesPosted Apr 4, 2012, 2:35 PM
David SmithPosted Apr 4, 2012, 1:55 PM
VulpesPosted Apr 4, 2012, 9:39 AM
In other words what is the Unicode codepoint for the dash (or hyphen) that you want to replace?
There must be at least 10 possibilities.