[Closed] How to find "" inside a string?
I have this string:
"#(#(#p2p, true, #(false, "static"), #((color 0 255 0), (color 0 255 0), (color 0 0 0)), #(#("83.054"", [-31.3552,33.1015,0], [20.9261,-31.4324,0])), #(false, #()), true, undefined))"
The problem is this part:
“83.054″”
It breaks the string. How I can find “” inside the string using matchPattern or findString?
“matchpattern” returns a Boolean so you might find “findstring”, although slower, to be more useful.
matchpattern <string> pattern:"*\"\"*"
findstring <string> "\"\""
Thank you. It works. For some stupid reasons I tried
matchpattern <string> pattern:"\"\""
, but not including *.
it’s better to use findstring in your case. because you have to know where it is as well.
If you need to remove the double quotes, perhaps you could also use:
substitutestring <string> "\"\"" "\""
I need this:
"83.054""
to not brake the whole string, so when I use execute command the returned value to be an array and the
"83.054""
to be read as 83.054″ (decimal inches), but to be a string, so I can assign it where I need.
The ’ ‘(without space) for now is a solution.
I mean you could just use “substitutestring” instead of “findstring + replace”. Althought it’s slower, the advantage is that it is only one line and it will replace all the matches in the string.
If you need to replace the Double Quotes by a Double Apostrophe you could use:
substitutestring <string> "\"\"" "''"
i’m measuring gas in gallons, driving distance in miles… but i still can’t measure a size in feet/inches