expandtabs()

my_str.expandtabs(number))
number : optional , number of space to replace tab character.

By default expandtabs() ads 8 space by replacing all tab characters. We can set the number of spaces by giving input parameter.
my_str='a\tbc\tdef\tghij\tklmno'
my_str=my_str.expandtabs()
print(my_str)
Output
a       bc      def     ghij    klmno
my_str='a\tbc\tdef\tghij\tklmno'
my_str=my_str.expandtabs(1)
print(my_str)
Output
a bc def ghij klmno
All String methods



plus2net.com



Post your comments , suggestion , error , requirements etc here




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer