Why am I getting System.char[] printed out in this case?

前端 未结 2 1282
感动是毒
感动是毒 2021-02-19 11:07

I\'m trying to figure out what I\'m doing wrong here, but I can\'t seem to. I have this method that takes in a string and reverses it. However, when I print out the reversed str

2条回答
  •  春和景丽
    2021-02-19 11:44

    Calling ToString on a T array in .NET will always return "T[]". You want to use this instead: new string(reversedString).

提交回复
热议问题