Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

106
Views
Is it possible to shorten an OR statement with multiple conditions on the same variable?

Is there a way of shortening if(a=="bcd" || a=="efg")?

Because the conditions are both on a It would be nice to write something like if(a=="bcd"||"efg") and contract the statement. I know I could write something custom to handle it, but was wondering if there is anything built into C# that would accomplish it?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

With C# 9's patterns, you can write:

if (a is "bcd" or "efg")
{

}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!