From f6638e80314d8219e065a378e28e55e9dface47c Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 5 Jun 2014 10:32:03 -0400 Subject: [PATCH] lib/standard/ropes: Added prepend service, alias to insert_at(0). Signed-off-by: Lucas Bajolet --- lib/standard/ropes.nit | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/standard/ropes.nit b/lib/standard/ropes.nit index f4221b0..c8409a2 100644 --- a/lib/standard/ropes.nit +++ b/lib/standard/ropes.nit @@ -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 -- 1.7.9.5