Skip to content

Commit bdbb3de

Browse files
[Intl] Add a special locale to strip emojis
1 parent 7a79bc7 commit bdbb3de

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)