Stream: Coq users

Topic: How to escape double quote in a string?


view this post on Zulip Mikkel Milo (Oct 23 2020 at 09:21):

How can I make a string representation of " ? It seems that it is only possible to represent two consecutive double quotes with """".
Using the ascii code for double quote (034) also prints two double quotes for some reason:

 Compute ("hello " ++ double_quote ++ "...").
    = "hello ""..."

whereas I would expect this to print "hello "..." instead. Is this intended behavior?

view this post on Zulip Li-yao (Oct 23 2020 at 14:21):

"""" is actually how you escape a single double quote.

view this post on Zulip Li-yao (Oct 23 2020 at 14:22):

So the string "hello ""..." in Gallina represents the ascii string hello "...


Last updated: Feb 09 2023 at 00:03 UTC