X-Git-Url: http://nitlanguage.org diff --git a/tests/example_procedural_string.nit b/tests/example_procedural_string.nit index 126fb85..069ed21 100644 --- a/tests/example_procedural_string.nit +++ b/tests/example_procedural_string.nit @@ -16,15 +16,15 @@ # A procedural program (without explicit class). -meth first_word(s: String): String +fun first_word(s: String): String do - var result = new String + var result = new Buffer var i = 0 while i < s.length and s[i] != ' ' do result.add(s[i]) i = i + 1 end - return result + return result.to_s end print(first_word("Hello world!"))