Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 865857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:42:21+00:00 2026-05-15T09:42:21+00:00

Let us say I have this code string seachKeyword = ; List<string> sl =

  • 0

Let us say I have this code

string seachKeyword = "";
List<string> sl = new List<string>();
sl.Add("store");
sl.Add("State");
sl.Add("STAMP");
sl.Add("Crawl");
sl.Add("Crow");
List<string> searchResults = sl.FindAll(s => s.Contains(seachKeyword));

How can I ignore the letter case in Contains search?

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T09:42:21+00:00Added an answer on May 15, 2026 at 9:42 am

    The best option would be using the ordinal case-insensitive comparison, however the Contains method does not support it.

    You can use the following to do this:

    sl.FindAll(s => s.IndexOf(searchKeyword, StringComparison.OrdinalIgnoreCase) >= 0);
    

    It would be better to wrap this in an extension method, such as:

    public static bool Contains(this string target, string value, StringComparison comparison)
    {
        return target.IndexOf(value, comparison) >= 0;
    }
    

    So you could use:

    sl.FindAll(s => s.Contains(searchKeyword, StringComparison.OrdinalIgnoreCase));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

let say I have this code Map<String, String> list = new HashMap<String, String>(); list.put(number1,
Let's say I have this code in Java: HashSet<String> wordSet = new HashSet<String>(); String
Let's say I have a string like this. Dim str As String = code
Let's say that I have a block of code like this: keysPressed = new
Let's say I have this code: val string = one493two483three val pattern = two(\d+)three.r
So, let's say I have this code (VB.Net): Sub Main() dim xxx as string
Let's say I have some code like this in AS3 for(...) thing = new
Let's say I have this: public class Whatever { private ArrayList<String> myList = new
I have this code: List<string> lineList = new List<string>(); in j = 0; Dictionary<string,
Let's say I have this piece of code: CGColorSpaceRef colorSpaceRGB = CGColorSpaceCreateDeviceRGB(); CGContextSetStrokeColorSpace(context, colorSpaceRGB);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.