Hey Ralf,
If you want to make it Client side, I believe JS or JQuery already have some built in functions...
See here.
I tested in my browser console and it worked:

So, when using reactive or mobile apps, I believe you can use a Javascript function to do it.
Hope it helps :)
Cheers and Regards,
RR