Text.RemoveRange
A text with a run of characters cut out at a position.
Group: Text and characters. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Text.RemoveRange(text as nullable text, offset as number, optional count as nullable number) as nullable text
| Parameter | Type | Description |
|---|---|---|
text | nullable text | The text to work on; null gives null. |
offset | number | Where the cut begins, from 0. |
count | nullable number optional | How many characters to cut. Left out, one. |
Returns
nullable text. The shorter text; an error when the cut reaches past the end.
Examples
One character
Text.RemoveRange("SKU-123", 3)
"SKU123"
Five characters
Text.RemoveRange("NO-0150-Oslo", 2, 5)
"NO-Oslo"