How to convert Set to String[]?

前端 未结 7 1829
栀梦
栀梦 2020-11-28 19:12

I need to get a String[] out of a Set, but I don\'t know how to do it. The following fails:

Map myMa         


        
相关标签:
7条回答
  • 2020-11-28 19:40

    Use toArray(T[] a) method:

    String[] array = set.toArray(new String[0]);
    
    0 讨论(0)
提交回复
热议问题