Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
end
# Returns `self` as a new String.
- redef fun to_s_with_copy: FlatString
+ redef fun to_s_with_copy do return to_s_with_copy_and_length(cstring_length)
+
+ # Get a `String` from `length` bytes at `self` copied into Nit memory
+ fun to_s_with_copy_and_length(length: Int): String
do
- var length = cstring_length
var r = clean_utf8(length)
if r.items != self then return r
var new_self = new NativeString(length + 1)