Text functions

Text functions functions for Power Query M language.

Functions

FunctionDescription
Character.FromNumberThis function provides the character that corresponds to a given numeric value.
Character.ToNumberThis function will return the numerical value of the input character.
Guid.FromThe function returns a Guid.Type value based on the input value. If the input value is null, the function returns null as well. It includes a validation process to ensure the input value is in the cor...
Json.FromValueThis function generates a JSON format of a given value, using a specified text encoding provided by encoding. If encoding is not specified, UTF8 is used as the default. The values are represented in t...
Text.AfterDelimiterThis function retrieves the text that appears after a designated delimiter. Users have the option to specify a numeric index to indicate which occurrence of the delimiter should be used. Additionally,...
Text.AtThis function retrieves a specific character from a given text value at the specified position, known as the index. It is worth noting that the first character in the text is located at position 0.
Text.BeforeDelimiterThis function retrieves the text before a specified delimiter. It includes optional parameters to specify which occurrence of the delimiter should be used and whether the indexing should start from th...
Text.BetweenDelimitersThis function retrieves the text located between the specified startDelimiter and endDelimiter. It also allows optional input for a numeric startIndex to specify which instance of the startDelimiter t...
Text.CleanThis function returns a string value that has been stripped of all control characters.
Text.CombineThis function returns a single text value that is a combination of the list of text values provided. Null values in the list are not included in the final result. Optionally, a separator can be specif...
Text.ContainsThis function identifies if a text includes a specific value within it. It will return true if the value is located. Please note that this function does not work with wildcards or regular expressions....
Text.EndThis function retrieves a text value containing the last specified number of characters from the original text value.
Text.EndsWithThis indicates if the provided text ends with a specific value or substring. The comparison is sensitive to letter case. The comparer used controls the comparison. Comparers can adjust the comparison ...
Text.FormatThis function generates formatted text by plugging in arguments from a list or record into a specified format string. You can also specify an optional culture, such as "en-US".
Text.FromThe function returns the textual representation of a given value, which can belong to different data types such as number, date, time, datetime, datetimezone, logical, duration, or binary. If the prov...
Text.FromBinaryConverts binary data into text data using a specified encoding method.
Text.InferNumberTypeDetermines the specific numerical data type (Int64.Type, Double.Type, etc.) of the input text. An exception will be generated if the text is not a numerical value. There is an option to include a spec...
Text.InsertThis function returns the outcome of inserting a new text value (newText) into an existing text value (text) at a specific position (offset). Positions are numbered starting from 0.
Text.LengthThis function will provide the count of characters present in the specified text variable.
Text.LowerThis function converts all characters in the input text to lowercase. It allows for an optional parameter to specify the culture, such as "en-US".
Text.MiddleReturns a specified number of characters starting from a designated position within the text. If no specific count is provided, it will return characters up to the end of the text from the specified s...
Text.NewGuidGenerates a fresh, randomly generated globally unique identifier (GUID).
Text.PadEndThis function returns a text string that has been expanded to a specific length by adding spaces at the end of the original text. You may also choose to use a different character for padding by specif...
Text.PadStartIt will return a text value that has been padded to a specific length by adding spaces at the beginning of the text. You can also specify a different character to use for padding by including the opti...
Text.PositionOfThis function retrieves the position of a specified text value substring within a larger text. An optional parameter, "occurrence," can be included to specify which occurrence position to return (with...
Text.PositionOfAnyThis function will retrieve the index of the first instance of a character from a specified list (characters) within a given text. The optional argument 'occurrence' can be used to choose which specif...
Text.ProperThe function will capitalize the initial letter of each word in the provided text while converting all other letters to lowercase. It also allows the inclusion of an optional culture parameter, such a...
Text.RangeThis function retrieves a portion of the text starting from a specified position called offset. Additionally, users can choose to specify the number of characters to extract by including an optional p...
Text.RemoveEliminates any instances of a specific character or set of characters from a given text value. The removeChars parameter can consist of either a single character or a series of character values.
Text.RemoveRangeThis function returns a new text value that excludes the characters starting from the specified offset position. You can also specify an optional parameter, count, to indicate the number of characters...
Text.RepeatThis function generates a new text value by repeating the original input text a specified number of times.
Text.ReplaceThis function returns the outcome of substituting all instances of the old text value with the new text value in the specified text. It is important to note that this function distinguishes between lo...
Text.ReplaceRangeThis function returns the outcome of eliminating a specified quantity of characters, count, from the text value text starting at position offset. Afterwards, it inserts the text value newText at the s...
Text.ReverseInverts the given text.
Text.SelectThe function returns a modified version of the input text, where all the characters not specified in the selectChars parameter are removed.
Text.SplitThis function generates a list of text values by breaking down a given text value according to a specific delimiter or separator.
Text.SplitAnyThis function generates a list of text values by dividing a given text value based on any character present in the specified delimiter set.
Text.StartThis function retrieves the initial count characters from the given text and returns them as a text value.
Text.StartsWithThis function returns true if the specified text value begins with the specified substring value. text: The text value that will be searched. substring: The text value that will be searched for withi...
Text.ToBinaryConverts the provided text input, text, into a binary format using the chosen encoding method.
Text.ToListThis function retrieves a collection of individual character values from the specified text input.
Text.TrimThis function removes any blank spaces at the beginning or end of a text value and returns the modified text.
Text.TrimEndEliminates any specified characters from the end of the original text value using trimChars.
Text.TrimStartEliminates any instances of the specified characters in trimChars from the beginning of the original text value.
Text.UpperThe function converts all characters in the input text to uppercase. It also allows for an optional culture parameter to be specified, such as "en-US".