1VMOD_STR(3)                                                        VMOD_STR(3)
2
3
4

NAME

6       vmod_str - Str VMOD
7

SYNOPSIS

9          import str [as name] [from "path"]
10
11          INT count(STRING s)
12
13          BOOL startswith(STRING s1, STRING s2)
14
15          BOOL endswith(STRING s1, STRING s2)
16
17          BOOL contains(STRING s1, STRING s2)
18
19          STRING take(STRING s, INT n, INT offset)
20
21          STRING reverse(STRING s)
22
23          STRING split(STRING S, INT n, STRING sep)
24

DESCRIPTION

26   INT count(STRING s)
27       Returns the number of ascii characters in S, or -1 if S is null.
28
29   BOOL startswith(STRING s1, STRING s2)
30       Returns true if S1 starts with S2.
31
32   BOOL endswith(STRING s1, STRING s2)
33       Returns true if S1 ends with S2.
34
35   BOOL contains(STRING s1, STRING s2)
36       Returns true if S1 contains S2.
37
38   STRING take(STRING s, INT n, INT offset=0)
39       Returns  a  string  composed  of  the  N first characters of S. If S is
40       shorter than N character, the return string is truncated. If S is NULL,
41       NULL is returned.
42
43       A  negative  offset means "from the end of the string" and a negative n
44       means "left of the offset".
45
46   STRING reverse(STRING s)
47       Reverse s.
48
49   STRING split(STRING S, INT n, STRING sep=" t")
50       Split s and return the n-th token. Characters in sep are separators.  A
51       negative n indicate "from the end of the string".
52
54          Copyright (c) 2016 Guillaume Quintard
55
56          Author: Guillaume Quintard <guillaume.quintard@gmail.com>
57
58          (vmodtool requires this format.)
59
60
61
62
63                                                                   VMOD_STR(3)
Impressum