Java - “String index out of range” exception

前端 未结 5 1985
再見小時候
再見小時候 2021-01-16 04:14

I wrote this little function just for practice, but an exception (\"String index out of range: 29\") is thrown and I don\'t know why...

(I know this isn\'t the best

5条回答
  •  猫巷女王i
    2021-01-16 05:14

    Java strings are not null-terminated. Use String.length() to determine where to stop.

提交回复
热议问题