How to convert IEnumerable to one comma separated string?

前端 未结 6 1650
北荒
北荒 2021-01-01 08:20

Say that for debugging purposes, I want to quickly get the contents of an IEnumerable into one-line string with each string item comma-separated. I can do it in a helper met

6条回答
  •  耶瑟儿~
    2021-01-01 09:06

    to join large array of strings to a string, do not directly use +, use StringBuilder to iterate one by one, or String.Join in one shot.

提交回复
热议问题