How to copy a string with all tab characters replaced with space characters in Python

1 Answer

0 votes
string = "php\tpython\tjava\tc"

s = string.expandtabs()

print(s)
 
 
 
'''
run:
 
php     python  java    c
 
'''

 



answered Dec 11, 2019 by avibootz
...