1Prelude.substr(3kaya)        Kaya module reference       Prelude.substr(3kaya)
2
3
4

NAME

6       Prelude::substr - Return a substring.
7

SYNOPSIS

9       String substr( String x, Int i, Int len )
10

ARGUMENTS

12       x The original string
13
14       i The starting index
15
16       len The substring length
17

DESCRIPTION

19       Starting  at  character  i  , return the len characters long substring.
20       Throws an Exception if len is negative, or if i  is  out-of-bounds.  In
21       Kaya  0.2.4  and earlier, an Exception was also thrown if len was zero.
22       The empty string is now returned in this case.
23
24       If the starting index is negative, then it will be counted  in  characā€
25       ters from the end of the string.
26
27
28    x = "abcdef";
29    s = substr(x,0,2); // "ab"
30    s = substr(x,4,1); // "e"
31    s = substr(x,3,10); // "def" ( len
32    truncated)
33    s = substr(x,-4,2); // "cd"
34

AUTHORS

36       Kaya   standard  library  by  Edwin  Brady,  Chris  Morris  and  others
37       (kaya@kayalang.org). For further information see http://kayalang.org/
38

LICENSE

40       The Kaya standard library is free software;  you  can  redistribute  it
41       and/or  modify  it  under  the  terms  of the GNU Lesser General Public
42       License (version 2.1 or any later version) as  published  by  the  Free
43       Software Foundation.
44
45
46
47Kaya                             December 2010           Prelude.substr(3kaya)
Impressum