Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

? operator

condition ? consequent : alternative

var rand = new Random();
var condition = rand.NextDouble() > 0.5;

var x = condition ? 12 : (int?)null;

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/conditional-operator
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# dictionary get key by value 
Csharp :: remove item from list in for loop c# 
Csharp :: return an interface or a class C# 
Csharp :: c# delete files 
Csharp :: unity list get item at index 
Csharp :: unity set parent canvas 
Csharp :: npm add auth token 
Csharp :: c# sum object values 
Csharp :: expansion tile 
Csharp :: c# increment by 1 
Csharp :: SieveOfEratosthenes 
Csharp :: enum in c# 
Csharp :: get file name from stream c# 
Csharp :: calculator in c# 
Csharp :: how to decrease velocity of a Unity rigidbody 
Csharp :: ultimate space cruiser 
Csharp :: rotation 
Csharp :: Get Mac address of Device in Xamarin 
Csharp :: loading player preferences unity 
Csharp :: sharepoint c# get list item query by lookup 
Csharp :: How do I allow edit only a particular column in datagridview in windows application 
Csharp :: telerik mvc grid column with icon 
Csharp :: c# loop 2 time tables 
Csharp :: concatanate two lists in c# 
Csharp :: how to know pm or am C# 
Csharp :: web client ignore ssl error 
Csharp :: blazor image button 
Csharp :: trhow exception if is null c# 
Csharp :: dapper get list 
Csharp :: the name scripts does not exist in the current context mvc 5 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =