Skip to content
Advertisement

How to split and join a text considering special characters?

My Input is this: 'z<*zj'; I am looking a Output as : j<*zz;

here in this string, special characters not changed in position. But the letters arranged reversed alphabets. I am trying to get the output, but not works.

any one help me with shortest and correct way to get this?

my try:

JavaScript

Thanks in advance

Advertisement

Answer

Not sure if I understand you correctly.
But I think you want to sort only the letters without changing non-letters?

Here is my approach:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement