@@ -165,8 +165,10 @@ There is also a method to get the bytes stored at some position::
165165 b('नमस्ते')->bytesAt(1); // [164]
166166 u('नमस्ते')->bytesAt(1); // [224, 164, 174]
167167
168- Methods Related to Length and White Spaces
169- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168+ .. _methods-related-to-length-and-white-spaces :
169+
170+ Methods Related to Length and Whitespace Characters
171+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170172
171173::
172174
@@ -190,14 +192,14 @@ Methods Related to Length and White Spaces
190192 END";
191193 u($text)->width(); // 14
192194
193- // only returns TRUE if the string is exactly an empty string (not even white spaces )
195+ // only returns TRUE if the string is exactly an empty string (not even whitespace )
194196 u('hello world')->isEmpty(); // false
195197 u(' ')->isEmpty(); // false
196198 u('')->isEmpty(); // true
197199
198- // removes all white spaces from the start and end of the string and replaces two
199- // or more consecutive white spaces inside contents by a single white space
200- u(" \n\n hello world \n \n")->collapseWhitespace(); // 'hello world'
200+ // removes all whitespace (' \n\r\t\x0C') from the start and end of the string and
201+ // replaces two or more consecutive whitespace characters with a single space (' ') character
202+ u(" \n\n hello \t \n\r world \n \n")->collapseWhitespace(); // 'hello world'
201203
202204Methods to Change Case
203205~~~~~~~~~~~~~~~~~~~~~~
@@ -286,7 +288,7 @@ Methods to Pad and Trim
286288 // repeats the given string the number of times passed as argument
287289 u('_.')->repeat(10); // '_._._._._._._._._._.'
288290
289- // removes the given characters (by default, white spaces ) from the string
291+ // removes the given characters (default: whitespace characters ) from the beginning and end of a string
290292 u(' Lorem Ipsum ')->trim(); // 'Lorem Ipsum'
291293 u('Lorem Ipsum ')->trim('m'); // 'Lorem Ipsum '
292294 u('Lorem Ipsum')->trim('m'); // 'Lorem Ipsu'
0 commit comments