Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Inline "If" like function for strings in C#

Posted on 2011-10-07
1
Medium Priority
?
277 Views
Last Modified: 2012-06-27
Hello Experts,

My c# knowledge stinks.  I'm trying to recall a function where I could state something like the following:

txtlevel.text = if(mystring = "1", truepart, falsePart);

If you could help me recall what this is I'd really appreciate it.

Thanks
0
Comment
Question by:eshurak
1 Comment
 
LVL 6

Accepted Solution

by:
effes earned 2000 total points
ID: 36934294
txtlevel.text = mystring == "1" ? truepart : falsePart;

Open in new window

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Integration Management Part 2
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question