查询首字母为 数字 的记录
                    
                    
                1 回答
 
                    
                    
                            撒科打诨
                            
                                
                            
                        
                        
                                                
                    TA贡献1934条经验 获得超2个赞
List<string> strlist = new List<string>();
            strlist.Add("1asdf");
            strlist.Add("2asdf");
            strlist.Add("easdf");
            strlist.Add("tasdf");
            var list = from l in strlist
                       where ASCIIEncoding.ASCII.GetBytes(l.ToString().Substring(0,1))[0] >= 48 && ASCIIEncoding.ASCII.GetBytes(l.ToString().Substring(0,1))[0] <= 57
                       select l;
            foreach(string str in list)
            {
                Console.WriteLine(str);
            }
- 1 回答
- 0 关注
- 364 浏览
添加回答
举报
0/150
	提交
		取消
	