I\'m trying to remove the lower case letters on a TextBox..
For example, short alpha code representing the insurance (e.g., \'BCBS\' for \'Blue Cross B
I´d map the value to your abbreviation in a dictionary like:
Dictionary valueMap = new Dictionary();
valueMap.Add("Blue Cross Blue Shield", "BCBS");
string Code = "";
if(valueMap.ContainsKey(txtDesc.Text))
Code = valueMap[txtDesc.Text];
else
// Handle
But if you still want the functionality you mention use linq:
string newString = new string(txtDesc.Text.Where(c => char.IsUpper(c).ToArray());