Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
If you are trying to learn pig Latin but you keep getting attacked by a unicorn, you might need to reverse a string to keep the bed bugs at bay.
-
Voxera113888ySome langs do not have an indexof that can search from the end of a string.
Instead if rolling your own you reversed both strings and used the normal index of.
Not the optimal performance but easier than building your own string match. -
@karma you could test that with an empty function and it'd still work. Fun fact : Palindrome is not a palindrome
-
BadReg588yIn SQL if you need to trim the end of a string it's way easier to reverse the string and remove the characters from the front then reverse it again. It's not impossible to do it the other way but good lord is it a hassle.
-
Well, I just reversed a string as part of comma injection for numbers. Guess I answered my own question.
Related Rants
I'm curious...is there a practical application for reversing a string, other than for tutorials and interview questions?
undefined
strings
question
why?
reverse