Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

can you have multiple statement in a case c#

switch (value)
{
    case 1: case 2: case 3:          
        // Do Something
        break;
    case 4: case 5: case 6: 
        // Do Something
        break;
    default:
        // Do Something
        break;
}
Comment

switch expression c# multiple cases

var switchValue = 3;
var resultText = switchValue switch
{
    1 or 2 or 3 => "one, two, or three",
    4 => "four",
    5 => "five",
    _ => "unknown",
};
Comment

switch case with 2 variables c#

switch (intVal1, strVal2, boolVal3)
{
    case (1, "hello", false):
        break;
    case (2, "world", false):
        break;
    case (2, "hello", false):
        break;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: calling stored procedure in c# entity framework 
Csharp :: c# convert list t to datatable 
Csharp :: length of a string c# 
Csharp :: c# get foreground window 
Csharp :: how to set picturebox width with form width in c# 
Csharp :: get list length c# 
Csharp :: lcm of numbers 
Csharp :: qtablewidget add image 
Csharp :: C# Http.HttpRequestMessage 
Csharp :: c# get excel column number from letter 
Csharp :: check two lists are equal c# 
Csharp :: c# list of properties from list of objects 
Csharp :: multi line comment c# 
Csharp :: datetime empty date 
Csharp :: how to check if List<T element contains an item with a Particular Property Value in c# 
Csharp :: mongodb driver c# nuget 
Csharp :: c# randize list 
Csharp :: if checkbox checked in c# 
Csharp :: solid principles c# 
Csharp :: how to get current dir in c# 
Csharp :: how get the user show mvc controller core 3.1 
Csharp :: how to insert into a list c# 
Csharp :: mvc session key exists 
Csharp :: the same schemaid is already used for type swagger 
Csharp :: split lines c# 
Csharp :: asp.net core 6 autofac 
Csharp :: take space separated input in c# 
Csharp :: destroy gameobject with tag unity 
Csharp :: wpf listview with columns binding 
Csharp :: migrationbuilder insert data example 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =