Как убрать табуляцию в python?

Пользователь

от ian.heidenreich , в категории: Python , год назад

Как убрать табуляцию в python?

Facebook Vk Ok Twitter LinkedIn Telegram Whatsapp

1 ответ

Пользователь

от NicolasSsh , год назад

@ian.heidenreich  Вы можете использовать метод строки .replace()


1
2
3
4
5
6
7
8
9
lineWithTabulation = "\tLine with tabulation"
print(lineWithTabulation)

lineWithoutTabulation = lineWithTabulation.replace('\t', '')
print(lineWithoutTabulation)

# Вывод :
#   Line with tabulation
# Line with tabulation