C# 3.0 Remove chars from string

c#, string

Solution

Regex (edited)?

string s = "lsg  @~A\tSd 2£R3 ad"; // note tab
s = Regex.Replace(s, @"\s+", " ");
s = Regex.Replace(s, @"[^a-zA-Z ]", ""); // "lsg A Sd R ad"

Problem

I have a string and what to - remove all characters except all english letters (a..z) - replace all whitespaces sequences with a single whitespace How would you do that with C# 3.0 ?

Original source