Text.PadEnd
A text made a given length by adding a character at the end.
Group: Text and characters. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Text.PadEnd(text as nullable text, count as number, optional character as nullable text) as nullable text
| Parameter | Type | Description |
|---|---|---|
text | nullable text | The text to work on; null gives null. |
count | number | The length the text should reach. |
character | nullable text optional | The character to add, one character. Left out, a space. |
Returns
nullable text. The padded text; a text already that long comes back as it is, never cut.
Remarks
- The pad must be exactly one character: a longer text is an error.
Examples
Dots after a product name
Text.PadEnd("Chair", 8, ".")
"Chair..."
A text longer than the count
Text.PadEnd("Trondheim", 4)
"Trondheim"