score:19
Accepted answer
borrowing a similar solution form here:
string[] result = {"hello there", "héllo there","goodbye"};
string word = "héllo";
var compareinfo = cultureinfo.invariantculture.compareinfo;
var filtered = result.where(
p => compareinfo.indexof(p, word, compareoptions.ignorenonspace) > -1);
score:-1
you want to use the stringcomparison.invariantcultureignorecase
enum.
source https://msdn.microsoft.com/en-us/library/system.stringcomparison(v=vs.110).aspx
filtered = result.contains(word, stringcomparison.invariantcultureignorecase);
however this is only going to work with linqtoobject. if you are using linqtosql or linqtoentityframework or linqtonhibernate, this will not work.
Source: stackoverflow.com
Related Query
- Linq Contains without considering accents
- Sequence contains no elements exception in linq without even using Single
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- LINQ Source Code Available
- Merge duplicate data without affecting others in LINQ code
- creating Linq to sqlite dbml from DbLinq source code
- LINQ entity data model generated code error - The type 'DBContexts.Category' already contains a definition for 'ID'
- The source contains no DataRows using Linq
- source code for LINQ 101 samples
- C# Dynamic Linq Query with Fluent Mongo - Without using Contains or PredicateBuilder
- Is there a way I can do a foreach that contains code in a LINQ expression?
- Linq to sql code for contains
- c# Linq or code to extract groups from a single list of source data
- Data paging in linq without removing records from the data source
- Convert string[] to int[] in one line of code using LINQ
- Code equivalent to the 'let' keyword in chained LINQ extension method calls
- LINQ Contains Case Insensitive
- linq where list contains any in list
- Determine if a sequence contains all elements of another sequence using Linq
- Linq code to select one item
- Error: "The specified LINQ expression contains references to queries that are associated with different contexts"
- How are people unit testing code that uses Linq to SQL
- Linq query list contains a list
- Use linq to generate direct update without select
- The source contains no DataRows
- Linq filter List<string> where it contains a string value from another List<string>
- Determine sequence contains no element using LINQ
- How to count the number of code lines in a C# solution, without comments and empty lines, and other redundant stuff, etc?
- Check if a string within a list contains a specific string with Linq
- LINQ To SQL exception: Local sequence cannot be used in LINQ to SQL implementation of query operators except the Contains operator
More Query from same tag
- LINQ to Entities does not recognize the method 'Boolean Contains(Int32)' method
- Remove Items from sub list matching another sub list with Linq
- LINQ query for string.replace
- Difference between OfType<>() and checking type in Where() extension
- Agregate rows with two or more columns with same value
- Linq issues querying two Collections of data
- Linq multi level inner join
- Why is RemoveAll(x => x.Condition) removing all my records?
- Issue with LINQ group by with count
- IEnumerable<List<DataRow>> does not contain a definition for ToList()
- How to construct Where Expression dynamically in Entity Framework?
- Take all in ternary operator in LINQ?
- How Do You Return True If A String Contains Any Item In An Array Of String With LINQ in VB.NET
- How to rewrite sql query to linq
- Help with Linq expression to return a list of strings based on field count
- Gridview sorting not working with Linq to SQL
- Why am I not getting .CopyToDataTable() in Linq Query()
- Generating indexes in Linq
- Using a StringBuilder variable in LINQ Method
- How to force XDocument to output the prolog in uppercase while preserving identation and formatting?
- Resolve LINQ query between WebService and ClientApplication
- Entity Framework and LINQ left join and include on same table
- How do I write a Func<T, bool> to return the entity with the most children?
- How to implement FIND method of EF in Unit Test?
- LINQ - Remove Parts of Expression Tree
- Linq to sql ! operator for nullable of type int
- LINQ Query IList<string> to JSon Format
- Combine two list elements into single element
- Linq guru - filtering related entities
- LINQ to Entities does not recognize the method, how to fix