我有一个带字符串的地图,我想将其转换为字符串列表,其中""作为键值分隔符.是否可以使用谷歌收藏?
我想用google集合做的代码示例:
public static List<String> addLstOfSetEnvVariables(Map<String, String> env)
{
ArrayList<String> result = Lists.newArrayList();
for (Entry<String, String> entry : env.entrySet())
{
result.add(entry.getKey() + " " + entry.getValue());
}
return result;
}
Run Code Online (Sandbox Code Playgroud)