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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:03:29+00:00 2026-06-12T21:03:29+00:00

I am a c++ developer and recently shifted to C#. I am developing a

  • 0

I am a c++ developer and recently shifted to C#. I am developing a WPF application where I need to check for the CASE Sensitive. I had done this in c++ as follows:

// BoardName and Board Version are of tye String
if(m_boardName->compareIgnoreCase("S1010012") == 0)
{   
    m_voltageChannels = redhookChannels;
}
else if(m_boardName->compareIgnoreCase("S1010018") == 0)//For bavaria board
{
    if(m_boardVersion->compareIgnoreCase("001A") == 0 || 
       m_boardVersion->compareIgnoreCase("001B") == 0 || 
       m_boardVersion->compareIgnoreCase("001C") == 0 )
    {
        m_voltageChannels = bavaria1Channels;
    }
    else if(m_boardVersion->compareIgnoreCase("002B") == 0)
    {
        m_voltageChannels = bavaria2Channel;
    }   
}

In my WPF application, I did this:

string redhookboardname = "S1010012";
    string redhookboardnameCase = "s1010012";

    string bavariaboardnameCase = "s1010018";
    string bavaria1boardversion1Case = "001a";
    string bavaria1boardversion2Case = "001b";
    string bavaria1boardversion3Case = "001c";

    string bavariaboardname = "S1010018";
    string bavaria1boardversion1 = "001A";
    string bavaria1boardversion2 = "001B";
    string bavaria1boardversion3 = "001C";

    string bavaria2boardversion = "002B";
    string bavaria2boardversionCase = "002b";

    public void OnChannel()
    {
        if (redhookboardnameCase.Equals(redhookboardname, StringComparison.InvariantCultureIgnoreCase))
        {
            mVoltageStruct = redhookboard;
        }

        else if (bavariaboardnameCase.Equals(bavaria1boardversion1, StringComparison.InvariantCultureIgnoreCase))
        {
            if (bavaria1boardversion1Case.Equals(bavariaboardname, StringComparison.InvariantCultureIgnoreCase)
                || bavaria1boardversion2Case.Equals(bavaria1boardversion2, StringComparison.InvariantCultureIgnoreCase)
                || bavaria1boardversion3Case.Equals(bavaria1boardversion3, StringComparison.InvariantCultureIgnoreCase))
            {
                mVoltageStruct = bavaria1board;
            }
            else if (bavaria2boardversionCase.Equals(bavaria2boardversion, StringComparison.InvariantCultureIgnoreCase))
            {
                mVoltageStruct = bavaria2board;
            }
        } 
    }

[UPDATED CODE]: Can this be achieved like I did above???

  • 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-12T21:03:31+00:00Added an answer on June 12, 2026 at 9:03 pm

    You can use the overload for string.Equals

    String.Equals Method (String, StringComparison)

    For example:

    string str1 = "s101001b";
    string str2 = "S101001B";
    if (str1.Equals(str2, StringComparison.InvariantCultureIgnoreCase))
    {
        //equal
    }
    

    You may also see one interesting article: The Turkish İ Problem and Why You Should Care

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a c++ developer and recently shifted to this amazing WPF world. I
I am developing a WPF application. I am basically a C++ developer and have
I am a C++ Developer and have recently shifted to C#. I am developing
I am a C++ developer and recently shifted to the world of WPF C#.
I am a C++ developer and i recently shifted to C# WPF. I am
I recently had an exchange with another C++ developer about the following use of
Recently I encountered a bug in an application I took over from another developer.
I am a C++ developer and recently shifted to C#. I am working on
I am a C++ developer and I recently shifted to C#. I am working
I am a C++ developer and recently started working on WPF. Well I am

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.