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 7997659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:00:55+00:00 2026-06-04T15:00:55+00:00

I am comparing two strings using following code string1.Contains(string2) but i am not getting

  • 0

I am comparing two strings using following code

string1.Contains(string2)

but i am not getting results for case insensitive search. Moreover I cant use String.Compare coz i dont want to match the whole name as the name is very big.
My need is to have case insensitive search and the search text can be of any length which the String1 contains.

Eg Term************** is the name.
I enter “erm” in textbox den i get the result. but when i enter “term” i dont get any result.
Can anyone help me 🙂

  • 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-06-04T15:00:56+00:00Added an answer on June 4, 2026 at 3:00 pm

    Try this:

    string.Equals("this will return true", "ThIs WiLL ReTurN TRue", StringComparison.CurrentCultureIgnoreCase)
    

    Or, for contains:

    if (string1.IndexOf(string2, StringComparison.CurrentCultureIgnoreCase) >= 0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've had some success comparing strings using the PHP levenshtein function. However, for two
I am comparing two strings, str1 and str2, using the string.compare function in #string.
Possible Duplicate: Comparing Two Arrays Using Perl I am trying to find elements that
I need help getting two pieces of data, and comparing them. What I am
Environment: VS2005 C++ using STLPort 5.1.4. Compiling the following code snippet: std::string copied =
I'm trying to compare the equality of two multi-line strings. I'm getting one of
The following code compares two XML texts and returns a collection of data changes
I'm comparing two strings like so: <?php $Str1 = '111122223333444455556666'; $Str2 = '111122223333444455557777'; if($Str1
Is there a fastest way to compare two strings (using the space for a
Possible duplicate : comparing-two-arrays I have two NSArray and I'd like to create a

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.