Created
April 30, 2015 15:12
-
-
Save nickpresta/e61dec7fbca5cbf843dd to your computer and use it in GitHub Desktop.
Lodash string methods vs underscore.string vs other languages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lodash | |
_.padRight('', 5, 'x'); // === '' | |
// underscore.string | |
s.rpad('', 5, 'x'); // === 'xxxxx' | |
// Python | |
'{:x<5}'.format('') # == 'xxxxx' | |
// Ruby | |
''.rjust(5, 'x') # "xxxxx" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I realize this may be intentional but it seems strange. Thoughts?