lib/standard/string: Proper handling of trivial cases in substring_from.
[nit.git] / lib / standard / string.nit
index 821672e..22c32e8 100644 (file)
@@ -178,7 +178,7 @@ abstract class Text
        # As with substring, a `from` index < 0 will be replaced by 0
        fun substring_from(from: Int): SELFTYPE
        do
-               if from > self.length then return empty
+               if from >= self.length then return empty
                if from < 0 then from = 0
                return substring(from, length - from)
        end