Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi I'm not interested in the linq
So I do not know what it
how to convert linq to usually code c#

XML
if (!Enumerable.Contains<char>((IEnumerable<char>) str1, e.KeyChar))
    e.KeyChar = Convert.ToChar(0);

if (!Enumerable.Contains<char>((IEnumerable<char>) str2, e.KeyChar) && !this.CTRL && !this.ALT)
  e.KeyChar = Convert.ToChar(0);
Posted

1 solution

You mean like this?
C#
if (!str1.Contains(e.KeyChar.ToString()))
     e.KeyChar = Convert.ToChar(0);

if (!str2.Contains(e.KeyChar.ToString()) && !this.CTRL && !this.ALT)
     e.KeyChar = Convert.ToChar(0);
 
Share this answer
 
v3
Comments
ahmadamiri 30-Aug-13 7:20am    
thanks
Thomas Daniels 30-Aug-13 7:20am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900