Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

How do I call a string inside a different class

static void Main(string[] args){
 var yourKeyword = "...Whatever";
 var theObjectYouWant = this.cardDataList.FirstOrDefault(x => x.CardType.StartsWith(yourKeyword));
 // the theObjectYouWant should contain the first match item or null in case of no match
 Console.WriteLine(theObjectYouWant.CardType);
}
 
PREVIOUS NEXT
Tagged: #How #I #call #string #class
ADD COMMENT
Topic
Name
6+7 =