Kaya 0.4.4 reference for Prelude::strEnd

List of functions and data types in Prelude

String strEnd(String x, Int i)

Arguments

Usage

Return the end of a string starting at character index i. strEnd(x,0) will return the entire string. If a negative i is given, then it will be counted backwards from the end of the string.

x = "abcdef";
putStr(strEnd(x,2)); // "cdef"
putStr(strEnd(x,5)); // "f"
putStr(strEnd(x,6)); // ""
putStr(strEnd(x,7)); // OutOfBounds Exception thrown
putStr(strEnd(x,-3)); // "def"
putStr(strEnd(x,-8)); // OutOfBounds Exception thrown

Related

kaya@kayalang.org | Last modified 29 November 2011 | Supported by Durham CompSoc | Powered by Kaya