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

Popular posts from this blog

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

Hard vs. Soft Water: What's The Difference?

The Ten Most Livable Cities In The World