c# - Function to return list of strings starting with a character -
i want write function taking list of strings , character, returns list of strings start character.
public list<string> sort(list<string> mylist, char mychar) { //this format want }
something should work described:
public list<string> sort(list<string> thelist, char thechar) { list<string> output = new list<string>(); foreach(string s in thelist) { if (s.startswith(thechar.tostring())) { output.add(s); } } return output; }
don't want sound harsh, if cant implement code yourself, under qualified job.
Comments
Post a Comment