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

  • Home
  • SEARCH
  • 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 7783787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:56:32+00:00 2026-06-01T19:56:32+00:00

if(stringName.charAt(0) != ‘Q’ || stringName.charAt(0) != ‘W’ || stringName.charAt(0) != ‘E’){ SetID = Yes;

  • 0
if(stringName.charAt(0) != 'Q' || stringName.charAt(0) != 'W' || stringName.charAt(0) != 'E'){

        SetID = "Yes";

    }

The above code when I use alert to popup the windows the value of My.String.charAt(0) is returning the correct value but I don’t know why it goes inside the if statement and change the value of SetID to Yes

I’m trying to figure out what is wrong with it and really can’t see anything

SetID is initialize to No

  • 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-01T19:56:34+00:00Added an answer on June 1, 2026 at 7:56 pm

    You’re using || but you probably mean && …

    The way it is now, it’ll always be true. “If the character is not ‘Q’, or it’s not ‘W’, or it’s not ‘E’, then …” — even if it is one of those characters, it will not be the others, so the expression evaluates to true.

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

Sidebar

Related Questions

Here's the code: string name = myName; int id = (int)_myDB.ThingTable.Where(thing => thing.ThingName ==
(LocalVariable)ABC.string(Name) = (IDataReader)dataReader.GetString(0); This name value is coming from database. What happening here is
an abstract in my mind is something like idontknow x = (idontknow) findViewById(R.string.stringname); so
I have taken String value from a EditText and set it inside SELECT QUERY
I want to update a control based on a value e.g: if (StringName ==
Just like the title says; I want to use something like Mid( stringName ,
Please clarify my doubt in Hashset. Consider the following code, class Person { String
I'm required to print a value of a string which within a resource files
i try to get the name attribute from an element and use that string
In Java, strings have a charAt() function. In C++, that function is simply stringname[INDEX]

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.