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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Apr 4, 2012, 5:39 AM EDT
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.
David SmithRank #999 · 2K reputationPosted Apr 4, 2012, 9:55 AM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 4, 2012, 10:35 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Apr 4, 2012, 3:14 PM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 5, 2012, 2:09 AM EDT
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 HobbsRank #107 · 20.5K reputationPosted Apr 5, 2012, 5:27 AM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 5, 2012, 6:34 AM EDT
David SmithRank #999 · 2K reputationPosted Apr 5, 2012, 8:40 AM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 5, 2012, 8:46 AM EDT
code = Regex.Replace( code, @"(\u2013|\u2014)", "-" );