Java demo:

        Map<String, User> map = new HashMap<>();
        map.put("id1", new User(1,"name1"));
        map.put("id2", new User(2,"name2"));

        String str = map.entrySet().stream().map(entry ->
            "id[" + entry.getKey() + "], code=" + entry.getValue().getCode() + ", text=" + entry.getValue().getText()
        ).collect(Collectors.joining("; "));
        System.out.println("str==="+str);

 

end.

相关文章:

  • 2021-06-27
  • 2021-09-20
  • 2022-12-23
  • 2022-01-12
  • 2021-11-24
猜你喜欢
  • 2022-01-24
  • 2022-12-23
  • 2021-12-10
  • 2021-11-30
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
相关资源
相似解决方案