Created
January 4, 2021 00:53
-
-
Save cevaris/b491d82b8da318a92fa2e2ce38769d6b to your computer and use it in GitHub Desktop.
snake_to_hyphen_case.py
This file contains hidden or 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
input = 'this_is_a_test_string' | |
output = '' | |
for i in range(0, len(input)): | |
char = input[i] | |
if char == '_': | |
output += '-' | |
else: | |
output += char | |
print(input) | |
print(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment