reference/strings/functions/ltrim.xml
27ae0a4a16cdfc868a884c0f0dad7023b5f2709c
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.ltrim">
3
+
<refentry xml:id="function.ltrim" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>ltrim</refname>
6
6
<refpurpose>Strip whitespace (or other characters) from the beginning of a string</refpurpose>
...
...
@@ -10,88 +10,45 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>string</type><methodname>ltrim</methodname>
13
-
<methodparam><type>string</type><parameter>str</parameter></methodparam>
14
-
<methodparam choice="opt"><type>string</type><parameter>character_mask</parameter></methodparam>
13
+
<methodparam><type>string</type><parameter>string</parameter></methodparam>
14
+
<methodparam choice="opt"><type>string</type><parameter>characters</parameter><initializer>" \n\r\t\v\x00"</initializer></methodparam>
15
15
</methodsynopsis>
16
-
<para>
16
+
<simpara>
17
17
Strip whitespace (or other characters) from the beginning of a string.
18
-
</para>
18
+
</simpara>
19
+
<simpara>
20
+
Without the second parameter,
21
+
<function>mb_ltrim</function> will strip these characters:
22
+
</simpara>
23
+
&strings.stripped.characters;
19
24
</refsect1>
20
25

21
26
<refsect1 role="parameters">
22
27
&reftitle.parameters;
23
-
<para>
24
-
<variablelist>
25
-
<varlistentry>
26
-
<term><parameter>str</parameter></term>
27
-
<listitem>
28
-
<para>
29
-
The input string.
30
-
</para>
31
-
</listitem>
32
-
</varlistentry>
33
-
<varlistentry>
34
-
<term><parameter>character_mask</parameter></term>
35
-
<listitem>
36
-
<para>
37
-
You can also specify the characters you want to strip, by means of the
38
-
<parameter>character_mask</parameter> parameter.
39
-
Simply list all characters that you want to be stripped. With
40
-
<literal>..</literal> you can specify a range of characters.
41
-
</para>
42
-
</listitem>
43
-
</varlistentry>
44
-
</variablelist>
45
-
</para>
46
-
</refsect1>
47
-

48
-
<refsect1 role="returnvalues">
49
-
&reftitle.returnvalues;
50
-
<para>
51
-
This function returns a string with whitespace stripped from the
52
-
beginning of <parameter>str</parameter>.
53
-
Without the second parameter,
54
-
<function>ltrim</function> will strip these characters:
55
-
<!-- sorted by importance. Printed 3 times: trim, ltrim, rtrim -->
56
-
<itemizedlist>
57
-
<listitem>
58
-
<simpara>
59
-
" " (<acronym>ASCII</acronym> <literal>32</literal>
60
-
(<literal>0x20</literal>)), an ordinary space.
61
-
</simpara>
62
-
</listitem>
63
-
<listitem>
64
-
<simpara>
65
-
"\t" (<acronym>ASCII</acronym> <literal>9</literal>
66
-
(<literal>0x09</literal>)), a tab.
67
-
</simpara>
68
-
</listitem>
69
-
<listitem>
70
-
<simpara>
71
-
"\n" (<acronym>ASCII</acronym> <literal>10</literal>
72
-
(<literal>0x0A</literal>)), a new line (line feed).
73
-
</simpara>
74
-
</listitem>
28
+
<variablelist>
29
+
<varlistentry>
30
+
<term><parameter>string</parameter></term>
75
31
<listitem>
76
32
<simpara>
77
-
"\r" (<acronym>ASCII</acronym> <literal>13</literal>
78
-
(<literal>0x0D</literal>)), a carriage return.
33
+
The input string.
79
34
</simpara>
80
35
</listitem>
36
+
</varlistentry>
37
+
<varlistentry>
38
+
<term><parameter>characters</parameter></term>
81
39
<listitem>
82
-
<simpara>
83
-
"\0" (<acronym>ASCII</acronym> <literal>0</literal>
84
-
(<literal>0x00</literal>)), the <literal>NUL</literal>-byte.
85
-
</simpara>
86
-
</listitem>
87
-
<listitem>
88
-
<simpara> <!-- not \v, since not supported by PHP -->
89
-
"\x0B" (<acronym>ASCII</acronym> <literal>11</literal>
90
-
(<literal>0x0B</literal>)), a vertical tab.
91
-
</simpara>
40
+
&strings.parameter.characters.optional;
92
41
</listitem>
93
-
</itemizedlist>
94
-
</para>
42
+
</varlistentry>
43
+
</variablelist>
44
+
</refsect1>
45
+

46
+
<refsect1 role="returnvalues">
47
+
&reftitle.returnvalues;
48
+
<simpara>
49
+
This function returns a string with whitespace stripped from the
50
+
beginning of <parameter>string</parameter>.
51
+
</simpara>
95
52
</refsect1>
96
53

97
54
<refsect1 role="examples">
...
...
@@ -149,16 +106,13 @@ string(15) "Example string
149
106

150
107
<refsect1 role="seealso">
151
108
&reftitle.seealso;
152
-
<para>
153
-
<simplelist>
154
-
<member><function>trim</function></member>
155
-
<member><function>rtrim</function></member>
156
-
</simplelist>
157
-
</para>
109
+
<simplelist>
110
+
<member><function>trim</function></member>
111
+
<member><function>rtrim</function></member>
112
+
</simplelist>
158
113
</refsect1>
159
114

160
115
</refentry>
161
-

162
116
<!-- Keep this comment at the end of the file
163
117
Local variables:
164
118
mode: sgml
165
119