Text.TrimStart
TextRemoves leading whitespace (or specified characters) from a text value.
Syntax
Text.TrimStart(text as nullable text, optional trim as any) as nullable textParameters
| Name | Type | Required | Description |
|---|---|---|---|
text | text | Yes | The text value to trim from the start. |
trim | any | No | A single character or list of characters to trim from the beginning. Defaults to whitespace. |
Return Value
text — The 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-4567 | 555) 123-4567 |
| 2 | (555) 234-5678 | 555) 234-5678 |
| 3 | (555) 345-6789 | 555) 345-6789 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks