You don't have to, but you can..I know you have to use regex
//regex
var output = Regex.Replace(input, "[^0-9.]", "");
//no regex, but LINQ
var output = string.Concat(input.Where(c => c is '.' or (>= '0' and <= '9')));
//or in really old money
var sb = new StringBuilder();
var h = "0123456789.".ToHashSet();
foreach(var c in input) if(h.Contains(c)) sb.Append(c);
var output = sb.ToString();
output = ""
for each character in input
if character is a number or a period then
append character to output
<p style="width:600;">123</p>
would result in 600123
.You don't have to, but you can..I know you have to use regex
//regex
var output = Regex.Replace(input, "[^0-9.]", "");
//no regex, but LINQ
var output = string.Concat(input.Where(c => c is '.' or (>= '0' and <= '9')));
//or in really old money
var sb = new StringBuilder();
var h = "0123456789.".ToHashSet();
foreach(var c in input) if(h.Contains(c)) sb.Append(c);
var output = sb.ToString();