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 RĂ©ponse
+ 6
namespace SoloLearn{
class Program{
static void Main(string[] args){
int[] arr = {1, 2, 3, 4};
int num = 4;
Console.WriteLine(arr.Contains(num));
}
}
}