0
C# Equivalent of pythons “if .. in” function?
In python you can check if a certain set of characters or etc is in a string with: if “string” in variable: What would the C# version of this be? Or do I have to use regular expressions ?
1 Antwort
+ 6
namespace SoloLearn{
class Program{
static void Main(string[] args){
int[] arr = {1, 2, 3, 4};
int num = 4;
Console.WriteLine(arr.Contains(num));
}
}
}