# Returns -1 if not found
#
# DEPRECATED : Use self.chars.last_index_of_from instead
- fun last_index_of_from(item: Char, pos: Int): Int
- do
- var iter = self.chars.reverse_iterator_from(pos)
- while iter.is_ok do
- if iter.item == item then return iter.index
- iter.next
- end
- return -1
- end
+ fun last_index_of_from(item: Char, pos: Int): Int do return chars.last_index_of_from(item, pos)
# Gets an iterator on the chars of self
#
end
# All kinds of array-based text representations.
-abstract class FlatText
+private abstract class FlatText
super Text
# Underlying C-String (`char*`)
#
# Warning : Might be void in some subclasses, be sure to check
# if set before using it.
- private var items: NativeString is noinit
-
- # Real items, used as cache for to_cstring is called
- private var real_items: nullable NativeString = null
+ var items: NativeString is noinit
# Returns a char* starting at position `first_byte`
#
#
# As always, do not modify the content of the String in C code, if this is what you want
# copy locally the char* as Nit Strings are immutable.
- private fun fast_cstring: NativeString is abstract
+ fun fast_cstring: NativeString is abstract
redef var length = 0