I would like to remove spaces(‘ ‘), dots(‘.’) and hyphens(-) from a string, using a regular expression.
My current approach:
string input = "hello how --r dsbadb...dasjidhdsa.dasbhdgsa--dasb";
var res = input
.ToCharArray()
.Where(i => i != ' ' && i != '-' && i != '.')
.Aggregate(" ", (a, b) => a + b);
should be easier and more readable.