I have a string containg alphabetic characters, for example:
Hi another solution is:
// add directive at the top
using System.Text.RegularExpressions;
string s = "24,99";
string numberOnly = Regex.Replace(s, "[^0-9,-]+", "")
This solution will not remove the dot e.g. question from user1804084:
this remove the dot for me e.g. 24.99 somechracter -> 2499
However it can still be convertet to a double where adding and subtraction works as normal.