It's 11:15pm so maybe I'm missing something...
''''
RIGHT(REPEAT(@padStr,@reqLen) + @origStr, @reqLen)
''''
This will build a dummy string and append the original, than take the Right X chars to give you the left pad
Coder | Dreamer | Blogger
Connect with me on LinkedIn @ www.linkedin.com/in/jamie-mcmanus-a103a967
When I'm not smashing keyboards and writing code, I am drinking Coffee and looking at the stars.
I don't think it replicates the functionality but its close !
The problem is RIGHT will truncate the leftmost characters of the dummy string , while LPad in mysql will truncate the characters on the right of the dummy string but before the original string
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It's 11:15pm so maybe I'm missing something...
''''
RIGHT(REPEAT(@padStr,@reqLen) + @origStr, @reqLen)
''''
This will build a dummy string and append the original, than take the Right X chars to give you the left pad
I don't think it replicates the functionality but its close !
The problem is RIGHT will truncate the leftmost characters of the dummy string , while LPad in mysql will truncate the characters on the right of the dummy string but before the original string