Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# string contains any of list

//linq
bool b = listOfStrings.Any(s=>myString.Contains(s));
//shorter but less clear
bool b = listOfStrings.Any(myString.Contains);
Comment

PREVIOUS NEXT
Code Example
Csharp :: rotate player unity 2d left and right 
Csharp :: c# windows forms print 
Csharp :: move files from one folder to another using c# 
Csharp :: c# remove character from string at index 
Csharp :: unity how to move an object 
Csharp :: int to bool c# 
Csharp :: C# calculate sum of digits of a number 
Csharp :: ienumerable foreach 
Csharp :: c# sum of list 
Csharp :: console.writeline in c# 
Csharp :: switch case in c# with multiple values 
Csharp :: linq where 
Csharp :: joystock movement 
Csharp :: function on animation exit unity 
Csharp :: winforms C# code cross thread operation is not valid 
Csharp :: No migrations configuration type was found in the assembly 
Csharp :: how to check if the value is alphabet only in c# 
Csharp :: c# random sleep 
Csharp :: unity audio manager 
Csharp :: c# isarray 
Csharp :: length of array c# unity 
Csharp :: remove all array elements c# 
Csharp :: How does works Unity interfaces 
Csharp :: declare dictionary c# 
Csharp :: how to read particular line of file in c# 
Csharp :: arcane 
Csharp :: transform.position.x unity 
Csharp :: how to print something in c# 
Csharp :: unity sort a list 
Csharp :: c# convert long to int 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =