Skip to content
Home » Remove characters from string in Power Query

Remove characters from string in Power Query

Power Query text function Text.Remove allow us to remove particular characters from string.

Text.Remove(text as nullable text, removeChars as any) as nullable text
text: given string

removeChars: characters that you want to remove from string.

It returns a copy of the text value text with all the characters from removeChars  removed.

Remove the character “t” from string “Microsoft Power Query”.

 Text.Remove("Microsoft Power Query", "t")

Output: Microsof Power Query

Note that: Power Query is case sensitive,  so if you provide upper case “T” in above M function then it will not remove character “t” from string because  string “Microsoft Power Query” does not contain any upper case character “T”.

Remove the characters “M”, “P”, “Q” from string “Microsoft Power Query”

Text.Remove(“Microsoft Power Query”, {“M”, “P”, “Q”})

Output: icrosoft ower uery




Also Read..

How to extract first and last characters from string

Loading

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SQL Skull

Subscribe now to keep reading and get access to the full archive.

Continue reading