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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:59:27+00:00 2026-06-03T22:59:27+00:00

I need the code logic for the following: These are the three String variables,

  • 0

I need the code logic for the following:

These are the three String variables,

String s1 = "A"; String s2 = "B"; String s3 = "C";

I need to have the following outputs based on the given scenarios:

  • Scenario #1 Actual output should be “A / B / C”
  • Scenario #2 When s1 is empty, output should be “B / C”
  • Scenario #3 When s2 is empty, output should be “A / C”
  • Scenario #4 When s3 is empty, output should be “A / B”`

Is this possible using ternary operation?

  • 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-03T22:59:28+00:00Added an answer on June 3, 2026 at 10:59 pm

    You can do:

    result = ((s1==null)?"":(s1+"/"))+((s2==null)?"":(s2+"/"))+((s3==null)?"":s3);
    

    See it

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

Sidebar

Related Questions

I need syntax help with the following code logic: I have a code block
I need the java code snippet for the below logic: Following is a string
I have the following working code: http://jsfiddle.net/tu8tc/2/ I need to add some logic so
i have this code, and need help with the logic end. I would like
I need ActionScriot code that will parse a given folder and search it for
I have the following controller code that returns a Json list object to my
I am building a Magento extension, in which I need to have the following
I'm using Entity Framework 4.1 Code First. In my entity, I have three date/time
I have the following code: public boolean perform(CronJob job) final Date lastQueryDateTime = new
Given that we have the following View: <StackPanel> <TextBlock Text=Some text/> <Image Source={Binding vmImageProp}

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.