Convert List of String to a String separated by a delimiter

前端 未结 4 1937
心在旅途
心在旅途 2021-01-31 14:45

Whats the best way to convert a list(of string) to a string with the values seperated by a comma (,)

4条回答
  •  借酒劲吻你
    2021-01-31 15:26

    A simple solution:

    dim str as string = ""
    for each item as string in lst
      str += ("," & item)
    next
    return str.substring(1)
    

    It takes off the first char from the string (",")

提交回复
热议问题