What is the best way to clear an array of strings?

后端 未结 7 1375
被撕碎了的回忆
被撕碎了的回忆 2021-02-19 02:13

What is the best way to clear an array of strings?

7条回答
  •  执念已碎
    2021-02-19 03:08

    Depending what you want:

    • Assign Nothing (null)
    • Assign a new (empty) array
    • Array.Clear

    Last is likely to be slowest, but only option if you don't want a new array.

提交回复
热议问题