Permalink
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (17 sloc) 489 Bytes
// <Snippet1>
using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"\p{Sc}*(\s?\d+[.,]?\d*)\p{Sc}*";
string replacement = "$1";
string input = "$16.32 12.19 £16.29 €18.29 €18,29";
string result = Regex.Replace(input, pattern, replacement);
Console.WriteLine(result);
}
}
// The example displays the following output:
// 16.32 12.19 16.29 18.29 18,29
// </Snippet1>