Skip to content

Commit 9ae0174

Browse files
committed
minor #12865 Add documentation for new reverse() method (MrYamous)
This PR was merged into the master branch. Discussion ---------- Add documentation for new reverse() method PR for issue #12850 Adding documentation in master for new reverse() method I was not sure whether it was necessary to create a new section or to add this method to an existing one, i'll edit according to your opinion if necessary. Commits ------- 9a4d9cd Add documentation for new reverse() method
2 parents 276022a + 9a4d9cd commit 9ae0174

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

components/string.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,19 @@ Methods to Join, Split and Truncate
358358
// breaks the string into pieces of the length given as argument
359359
u('0123456789')->chunk(3); // ['012', '345', '678', '9']
360360

361+
.. versionadded:: 5.1
362+
363+
The reverse() method was introduced in Symfony 5.1.
364+
365+
Method to Reverse
366+
~~~~~~~~~~~~~~~~~
367+
368+
::
369+
370+
// reverses the order of characters in a string
371+
u('foo bar')->reverse(); // 'rab oof'
372+
u('さよなら')->reverse(); // 'らなよさ'
373+
361374
Methods Added by ByteString
362375
~~~~~~~~~~~~~~~~~~~~~~~~~~~
363376

0 commit comments

Comments
 (0)