Hello
What would be the most efficient way to setup a string variable such
that the " char can be included into the string? (The problem is that
the string variable uses " " to enclose the string chars, and you cannot
use " inside the string....)
This string variable is then used to be sent out the serial port (uart1).
I did use the concatenation function in the calc icon ie. stringvar = str1+str2+str3,
where str2 is pre-defined as ascii char 0x22 as byte. Then send out stringvar out the uart1.
This works, but was just curious to know if this was the only way, or could
it be done more efficiently?
Thanx
Mark
String Manipulation
Moderator: Benj
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: String Manipulation
Can't try it myself at the moment, but try adding a backslash (\) before the double quotes. So the string would look like this: "this is an example with \" embedded"
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis