Jump to content

POWERED BY:

Archived

This topic is now archived and is closed to further replies.

Caio Bottigelli

Separar Strings com pipe

Recommended Posts


string = 'texto'

'|'.join(list(string.upper()))

#ou

'|'.join(list(str('texto').upper()))

"""

string.upper() -> transforma em caixa alta

list() -> transforma em lista

'|'.join() -> uni a lista inserindo o caractere entre as letras.

"""

Share this post


Link to post
Share on other sites

×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.