Skip to content

Commit 6cf5c14

Browse files
committed
Tweaks
1 parent 6f324aa commit 6cf5c14

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

components/string.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ There is also a method to get the bytes stored at some position::
177177
b('नमस्ते')->bytesAt(1); // [164]
178178
u('नमस्ते')->bytesAt(1); // [224, 164, 174]
179179

180+
.. _methods-related-to-length-and-white-spaces:
181+
180182
Methods Related to Length and Whitespace Characters
181183
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
182184

@@ -207,9 +209,9 @@ Methods Related to Length and Whitespace Characters
207209
u(' ')->isEmpty(); // false
208210
u('')->isEmpty(); // true
209211

210-
// removes all whitespace from the start and end of the string and replaces two
211-
// or more consecutive whitespace characters inside contents by a single white space
212-
u(" \n\n hello world \n \n")->collapseWhitespace(); // 'hello world'
212+
// removes all whitespace (' \n\r\t\x0C') from the start and end of the string and
213+
// replaces two or more consecutive whitespace characters with a single space (' ') character
214+
u(" \n\n hello \t \n\r world \n \n")->collapseWhitespace(); // 'hello world'
213215

214216
Methods to Change Case
215217
~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)