I have an array arr[] of string type with array-items as follows:
arr[0]= "2/13/2019|202"
arr[1]= "2/14/2019|197"
arr[2]= "2/15/2019|101"
arr[4]= "2/16/2019|271"
arr[5]= "2/17/2019|199"
I want to get an array-item that matches my string "2/15/2019" so I can get "2/15/2019|101". in short, I just want to compare my string with the array-item string till "|" and rest strong will not be considered for comparison. how can I get it?
var results = arr.Where(x => x.StartsWith("2/15/2019"));