arrays - What is C#'s most effective counterpart to Delphi's TStringList? -
in our delphi application, use tstringlist store strings , corresponding objects. project, need similar in c#, not sure effective way of doing is. far i've thought of using array list, list, or dictionary. 1 of these effective @ want do? if not, way go?
it depends features of tstringlist need. there's not direct replacement.
a dictionary<string,object>
unordered, , cannot have duplicate strings. there's no text property set strings @ once, etc. if ok you, i'd go that.
otherwise, might consider defining little class like:
public class item { public string string {get;set;} public object object {get;set;} }
and use list<item>
. gives ordered list of (string,object) tuples.
Comments
Post a Comment