If Array or List Contains name Remove

Assuming you have your names in array(of string) named strArr

1/ You could filter out all elements containing “HMD” using
strArr = arrStr.Where(function(x) not x.Contains("HMD")).ToArray

2/ You could remove “Mr.” “Ms.” etc using
strArr = arrStr.Select(function(x) x.Replace("Mr. ", "")).ToArray

3/ You format name using string manipulations described in

Alternatively 2/ and 3/ could be achieved by regular expression.

Cheers

5 Likes