Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

switch case c# range

int i = 63;

switch (i)
{
    case int n when (n >= 100):
        Console.WriteLine($"I am 100 or above: {n}");
        break;

    case int n when (n < 100 && n >= 50 ):
        Console.WriteLine($"I am between 99 and 50: {n}");
        break;

    case int n when (n < 50):
        Console.WriteLine($"I am less than 50: {n}");
        break;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: random from list c# 
Csharp :: how to create directory folder in c# 
Csharp :: c# read file by line 
Csharp :: c# count number of occurrences in string 
Csharp :: unity inspector how to get larger field for string text 
Csharp :: system command in c# 
Csharp :: get random point in collider unity 
Csharp :: c# check if element is last in list 
Csharp :: how to play video in ui unity 
Csharp :: get key unity 
Csharp :: how to detect when a player move in unity 
Csharp :: c# get last two characters of string 
Csharp :: c# unity camera follow player horizontal axis 
Csharp :: c# debug console log 
Csharp :: move to another scene unity 
Csharp :: Add float value to ui text in unity 
Csharp :: get apps execution path with app name c# 
Csharp :: change scene unity 
Csharp :: c# fontweight in code 
Csharp :: unity google play games plugin spam 
Csharp :: get all assemblies c# 
Csharp :: C# metodas duomenu paemimui veiksmams ir grazinimui 
Csharp :: enable canvas unity 
Csharp :: c# datetime iso 8601 format 
Csharp :: string format comma c# 
Csharp :: c# set int infinity 
Csharp :: how to add b to a string in java 
Csharp :: save file dialog filter c# 
Csharp :: if cluse in class in vue 
Csharp :: c# keyboard enter 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =