lib/standard/ropes: Added prepend service, alias to insert_at(0).
authorLucas Bajolet <r4pass@hotmail.com>
Thu, 5 Jun 2014 14:32:03 +0000 (10:32 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Thu, 5 Jun 2014 18:17:07 +0000 (14:17 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/standard/ropes.nit

index f4221b0..c8409a2 100644 (file)
@@ -210,6 +210,9 @@ class RopeString
                return new RopeString.from_root(last_concat)
        end
 
+       # Adds `s` at the beginning of self
+       fun prepend(s: String): String do return insert_at(s, 0)
+
        # Adds `s` at the end of self
        fun append(s: String): String
        do