Text.RemoveRange

 

This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.

Removes count characters at a zero-based offset from a text value.

Text.RemoveRange(text as nullable text, offset as number, count as number) as nullable text  

ArgumentDescription
textThe text to parse.
offsetThe index to start at.
countThe number of characters to remove.
  • If count is not specified, the default value of 1 is used.

  • If offset is less than zero or more than the length of a text value, or if count if less than zero then an Expression.Error is thrown.

Text.RemoveRange("abcdef", 2) equals "abdef"  

Text.RemoveRange("abcdef", 2, 2) equals "abef"  

Show: