Skip to main content
Cadet | Tier 2
July 5, 2022
Question

Hi All, I have one string variable ( say value=123ABC54664PQR21MNB), I want to reverse only character from the string and not the numbers. I want the output like "123CBA54664RQP21BNM" Need help here, Thanks in advance.

  • July 5, 2022
  • 1 reply
  • 43 views
Hi All, I have one string variable ( say value=123ABC54664PQR21MNB), I want to reverse only character from the string and not the numbers. I want the output like "123CBA54664RQP21BNM" Need help here, Thanks in advance.

    1 reply

    Ashwin A.K
    Navigator | Tier 3
    July 8, 2022

    Hi @Rahul Pawar​ ,

     

    Is this what you were looking for?

     

    image 

    If so, then here's the solution:

     

    image 

    imageimageimageimage 

    It was an interesting challenge, thank you for sharing it with us!

     

    Kind Regards,

    Ashwin A.K

     

    Blogs at TheCodingTheory - https://www.thecodingtheory.com