LearningOS/rcore_step_by_step

ex14

juanhair opened this issue · 1 comments

rust中不能用usize来index string,那么如何在for循环中使用从0到size_of(string)来遍历而不用for c in string.char()遍历

因为这里可能会有不同的语义:1. 遍历byte 2. 遍历 unicode code point 。Rust要求你选择其中的一种,所以没有提供下标操作。