How to remove lowercase on a textbox?

后端 未结 11 1821
难免孤独
难免孤独 2020-12-31 02:47

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

11条回答
  •  北海茫月
    2020-12-31 03:49

    string caps = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    
    string.Join("",
       "Blue Cross Blue Shield".Select(c => caps.IndexOf(c) > -1 ? c.ToString() : "")
                               .ToArray());
    

提交回复
热议问题