core :: UnicodeFlatString :: defaultinit
# Regular Nit UTF-8 strings
private class UnicodeFlatString
super FlatString
init full_data(items: CString, byte_length, from, length: Int) do
self._items = items
self._length = length
self._byte_length = byte_length
_first_byte = from
_bytepos = from
end
redef fun substring_from(from) do
if from >= self._length then return empty
if from <= 0 then return self
var c = char_to_byte_index(from)
var st = c - _first_byte
var fln = byte_length - st
return new FlatString.full(items, fln, c, _length - from)
end
end
lib/core/text/flat.nit:661,1--681,3