Created
August 18, 2023 11:05
-
-
Save goddoe/7a04fe6dd10cf4d501de3a4e7415910c 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
def strip_codeblock(code_with_codeblock): | |
first_newline_idx = code_with_codeblock.find("\n") | |
code_tmp = code_with_codeblock[first_newline_idx+1:] | |
code_closing_idx = code_tmp.find("```") | |
code_striped = code_tmp[:code_closing_idx] | |
return code_striped |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment