Skip to content

Commit 5d80157

Browse files
committed
minor #17637 [Intl] Add a special locale to strip emojis (alexandre-daubois)
This PR was merged into the 6.3 branch. Discussion ---------- [Intl] Add a special locale to strip emojis Resolves #17607 Commits ------- bdbb3de [Intl] Add a special locale to strip emojis
2 parents 7a79bc7 + bdbb3de commit 5d80157

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

components/string.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,17 @@ from GitHub or Slack, use the first argument of ``withEmoji()`` method::
552552
$slug = $slugger->slug('a 😺, 🐈‍⬛, and a 🦁');
553553
// $slug = 'a-smiley-cat-black-cat-and-a-lion';
554554

555+
If you want to strip emojis from a string, you can also use the special
556+
``strip`` locale::
557+
558+
use Symfony\Component\String\Slugger\AsciiSlugger;
559+
560+
$slugger = new AsciiSlugger();
561+
$slugger = $slugger->withEmoji('strip');
562+
563+
$slug = $slugger->slug('a 😺, 🐈‍⬛, and a 🦁');
564+
// $slug = 'a-and-a';
565+
555566
.. _string-inflector:
556567

557568
Inflector

0 commit comments

Comments
 (0)