convert string[] to int[]

后端 未结 7 923
一个人的身影
一个人的身影 2020-12-18 22:38

Which is the fastest method for convert an string\'s array [\"1\",\"2\",\"3\"] in a int\'s array [1,2,3] in c#?

thanks

7条回答
  •  醉酒成梦
    2020-12-18 23:23

    I suggest to iterate and int.TryParse()

    Which one is faster in processing and conversion int.Parse(), int.TryParse(), Convert.Int32()

    See Microsoft comparison of Parse , TryParse and ConvertTo

提交回复
热议问题