stdlib/strings: Removed usage of Strings as SequenceRead by using chars.
[nit.git] / tests / example_procedural_string.nit
index 069ed21..a78d01f 100644 (file)
@@ -20,8 +20,8 @@ fun first_word(s: String): String
 do
        var result = new Buffer
        var i = 0
-       while i < s.length and s[i] != ' ' do
-               result.add(s[i])
+       while i < s.length and s.chars[i] != ' ' do
+               result.add(s.chars[i])
                i = i + 1
        end
        return result.to_s