Text.TrimStart

Text

Removes leading whitespace (or specified characters) from a text value.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Text.TrimStart(text as nullable text, optional trim as any) as nullable text

Parameters

NameTypeRequiredDescription
texttextYesThe text value to trim from the start.
trimanyNoA single character or list of characters to trim from the beginning. Defaults to whitespace.

Return Value

textThe text with leading whitespace or specified characters removed.

Remarks

Text.TrimStart removes characters from the beginning of a text value only. By default it removes whitespace, but you can pass a character or list of characters to trim instead.

Examples

Example 1: Trim leading characters

Table.AddColumn(
    Table.SelectColumns(Table.FirstN(Employees, 3), {"Phone"}),
    "Trimmed", each Text.TrimStart([Phone], {"("}), type text
)
Result
Phone
Trimmed
1(555) 123-4567555) 123-4567
2(555) 234-5678555) 234-5678
3(555) 345-6789555) 345-6789

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks