delphi hashmap? [英] delphi hashmap?
问题描述
HashMap< String,String []> data = new HashMap< String,String []>();
我使用它来创建键值对。这些值是一个字符串数组。我必须迭代键值对的每个可能的组合(所以也必须遍历String [] - 数组)。这可以与java一起工作,但现在我必须将其移植到delphi。有可能吗?如何?
谢谢!
在Delphi 2009及更高版本中,您可以使用 TDictionary< string,TStringlist>
使用Genericics.Collections。
在旧版本中,您可以使用TStringlist,其中TStringlist中的每个项目都具有TStrings类型的关联对象值。
Docwiki有一个页面来开始与TDictionary
i have java-code filling a hashmap from a textfile.
HashMap<String, String[]> data = new HashMap<String, String[]>();
i use this to make key-value-pairs. the values are an array of string. i have to iterate over every possible combo of the key-value-pairs (so also have to iterate over the String[]-array). This works with java but now i have to port this to delphi. is it possible to do so? and how? thanks!
In Delphi 2009 and higher, you can use TDictionary<string, TStringlist>
using Generics.Collections.
In older versions, you can use TStringlist where every item in the TStringlist has an associated object value of type TStrings.
The Docwiki has a page to get started with TDictionary
这篇关于delphi hashmap?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!