This is my string value:
string str = \"32 ab d32\";
And this list is my allowed characters:
var allowedCharacters = new List&l
Without regex:
IEnumerable allowed = srVariable .Select(c => lstAllowedCharacters.Contains(c.ToString()) ? c : ' '); string result = new string(allowed.ToArray());