Welcome to my blog. This one is going to be a real short one and a useful one it.
In this blog I will discuss on how to escape a double quotes (“) from a string in canvas apps.
Let’s assume we want to set the following string to the Text of label control
This is the most common phrase - "A quick brown fox jumps over the lazy dog". Even more than the phrase - "Lorem ipsum"
Let’s try to set the Text property of the label to this value.
Quite obvious you need to escape the double quotes. Whenever we think of escaping the double quote, we usually use the backslash character (“\”).
As we can see, the backslash does not work here. So let’s see how we can escape the double quotes.
Just like on many other occasions, we need to use the Char function. To escape double quotes, we need to use Char(34) function.
Below is the modified version of the string which will work in canvas apps.
$"This is the most common phrase - {Char(34)}A quick brown fox jumps over the lazy dog{Char(34)}. Even more than the phrase - {Char(34)}Lorem ipsum{Char(34)}"
If you are wondering about the $ syntax and why we are using that instead of the regular & to append text, you can follow this blog link.
Hope this helped. You will also like the below posts
Debajit Dutta
Business Solutions MVP
Discover more from Debajit's Power Apps & Dynamics 365 Blog
Subscribe to get the latest posts sent to your email.