tabs_to_spaces

string

Converts tab characters to spaces

Syntax

tabs_to_spaces(string)

Parameters

string (string)

The string to convert

Returns

string

String with tabs replaced by spaces

Examples

Input:
tabs_to_spaces("hello\tworld")
Output:
"hello    world"
Input:
"a\tb" | tabs_to_spaces
Output:
"a    b"

The tabs_to_spaces() function converts tab characters to spaces. Typically converts each tab to a standard number of spaces (usually 4).

Usage

Use tabs_to_spaces() for normalizing code formatting, preparing text for systems that don’t handle tabs well, or standardizing whitespace.

Related Functions