summaryrefslogtreecommitdiffstats
path: root/source/rainerscript/functions/rs-trim.rst
blob: 835b17b2e0493462e2a4afe40a3036ffd7936d7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
*****************
ltrim() / rtrim()
*****************

Purpose
=======

ltrim
-----

ltrim(str)

Removes any spaces at the start of a given string. Input is a string, output
is the same string starting with the first non-space character.


rtrim
-----

rtrim(str)

Removes any spaces at the end of a given string. Input is a string, output
is the same string ending with the last non-space character.


Example
=======

ltrim
-----

In the following example the spaces at the beginning of the string are removed.

.. code-block:: none

   ltrim("   str ")

produces

.. code-block:: none

   "str "


rtrim
-----

In the following example the spaces at the end of the string are removed.

.. code-block:: none

   rtrim("   str ")

produces

.. code-block:: none

   "   str"