Last active
May 24, 2023 01:09
-
-
Save TyeolRik/f319f1c0fa23208bb15117ea6a193cb4 to your computer and use it in GitHub Desktop.
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
function camelcase_to_snakecase() { | |
local ret | |
ret=$(echo "$1" | sed -r 's/([A-Z])/_\L\1/g' | sed 's/^_//') | |
echo "$ret" | |
} | |
SomeString="helloWorldMyFriend" | |
snake_case=$(camelcase_to_snakecase "${SomeString}") | |
echo $snake_case |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment