Last active
October 31, 2019 19:07
-
-
Save david-botelho-mariano/8a9a1879259b8e1771a2a5f5185bb6c0 to your computer and use it in GitHub Desktop.
Regex de string em python
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
#regex de string | |
def get_string(variavel, inicio, fim): | |
variavel_array_primario = variavel.split(inicio) | |
variavel_array_secundario = variavel_array_primario[1].split(fim) | |
resultado = variavel_array_secundario[0] | |
return resultado | |
frase = "GitHub brings together the world's largest community of developers to discover, share, and build better software" | |
frase_filtrada = get_string(frase, 'together', 'to') | |
print(frase_filtrada) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment