You must Sign In to post a response.
  • Category: LINQ

    Make linq case insensitive

    Make linq case insensitive
    23 minutes ago|LINK


    I am trying to use the dynamic LINQ expression builder from

    However the I am not sure how to make the "equals" operation case insensitive.

    ase GridHelper.Operator.Equals:
    return Expression.Equal(member, constant);
    I want the above to be case insensitive either convert both to lower case or upper case, does not matter.

    Pls. any helpful pointers appreciated.

  • #760883

    I am not much aware about LINQ in depth.

    But you can do the following :


    string.Equals(member, constant, StringComparison.CurrentCultureIgnoreCase);


    StringComparer.CurrentCultureIgnoreCase.Equals(member, constant)


    StringComparer.CurrentCultureIgnoreCase.Compare(member, constant)

    Hope this will help you.

    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • Sign In to post your comments