Ruby - Convert Integer to String

前端 未结 7 1178
孤独总比滥情好
孤独总比滥情好 2021-01-17 11:28

In Ruby, trying to print out the individual elements of a String is giving me trouble. Instead of seeing each character, I\'m seeing their ASCII values instead:

<         


        
7条回答
  •  迷失自我
    2021-01-17 11:53

    @Chris,

    That's just how [] and [,] are defined for the String class.

    Check out the String API.

提交回复
热议问题