1. const string text = @"Historically, the world of data and the world of objects" + 2 @" have not been well integrated. Programmers work in C# or Visual Basic" + 3 @" and also in SQL or XQuery. On the one side are concepts such as classes," + 4 @" objects, fields, inheritance, and .NET Framework APIs. On the other side" + 5 @" are tables, columns, rows, nodes, and separate languages for dealing with" + 6 @" them. Data types often require translation between the two worlds; there are" + 7 @" different standard functions. Because the object world has no notion of query, a" + 8 @" query can only be represented as a string without compile-time type checking or" + 9 @" IntelliSense support in the IDE. Transferring data from SQL tables or XML trees to" + 10 @" objects in memory is often tedious and error-prone."; 11 12 const string searchTerm = "data"; 13 15 var source = text.Split(new[] { '.', '?', '!', ' ', ';', ':', ',' }, StringSplitOptions.RemoveEmptyEntries); 16 17 //创建查询,并忽略大小写比较 18 var matchQuery = from word in source 19 where string.Equals(word, searchTerm, StringComparison.InvariantCultureIgnoreCase) 20 select word;
Linq 语句模糊查询排除大小写
最新推荐文章于 2024-06-04 16:35:35 发布
本文探讨了数据世界与对象世界长期以来存在的不兼容问题。在不同的编程环境与数据处理方式中,程序员面临着从概念到实践的诸多障碍。文章强调了数据类型转换、标准函数不一致及对象与查询语言之间的鸿沟等问题。
1329

被折叠的 条评论
为什么被折叠?



