assert " \n\thello \n\t".l_trim == "hello \n\t"
Char::is_whitespace
determines what is a whitespace.
# Removes the whitespaces at the beginning of self
#
# ~~~
# assert " \n\thello \n\t".l_trim == "hello \n\t"
# ~~~
#
# `Char::is_whitespace` determines what is a whitespace.
fun l_trim: SELFTYPE
do
var iter = self.chars.iterator
while iter.is_ok do
if not iter.item.is_whitespace then break
iter.next
end
if iter.index == length then return self.empty
return self.substring_from(iter.index)
end
lib/core/text/abstract_text.nit:459,2--475,4