C#: Is there a way to resize an array of unknown type using reflection?

后端 未结 5 1843
臣服心动
臣服心动 2021-01-25 02:06

My users pass me an array of some type, say int[] or string[]. I can easily query the types of the elements via GetElementType, and I can find out how long the array was when i

5条回答
  •  猫巷女王i
    2021-01-25 03:04

    I guess I'll just switch to using Lists, but this is a shame; the code will be quite a bit messier looking and since my users are basically at the level of first-semester ugrads, each little thing will make their lives less good. But I'm suspecting that you folks don't see a way to do this either. Oh well....

提交回复
热议问题