C# 验证数字及字符串
今天无意间发现一种验证数字及字符串的方式:
验证字符串:
if ("asdf" is string){ MessageBox.Show("asdf是字符串");}
验证数字:
if (12.GetType()==typeof(Int32)){ MessageBox.Show("12是数字");}