Here are a couple of options
Only .NET 4 using string.Join:
string acronym = string.Join(string.Empty, input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(s => s[0]) );
In .NET 3.5 (or 4.0) you can:
string acronym = new string(input.Split(new[] {' '}, stringSplitOptions.RemoveEmptyEntries).Select(s => s[0]).ToArray());
Another option (my personal choice) based on your original logic:
string acronym = new string( input.Where( (c,i) => c != ' ' && (i == 0 || input[i-1] == ' ') ) .ToArray() );
Reed copsey
source share