Text.Range

 

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.

Returns the substring from the text text found at the offset offset. An optional parameter, count, can be included to specify how many characters to return. Throws an error if there aren't enough characters.

Text.Range(text as nullable text, offset as number, optional count as nullable number) as nullable text  

ArgumentDescription
textThe text to parse.
offsetThe index to start parsing at.
countThe number of characters to return.

Find the substring from the text "Hello World" starting at index 6.

Text.Range("Hello World", 6) equals "World"  

Find the substring from the text "Hello World Hello" starting at index 6 spanning 5 characters.

Text.Range("Hello World Hello", 6, 5) equals "World"  
  

Show: