Hacker News new | ask | show | jobs
by repsilat 2875 days ago
Does that help if those characters appear in the string?

My bet is on editors that let you "type your string into this text box".

3 comments

> Does that help if those characters appear in the string?

Yes, that's the whole point.

«With balanced quotes you can have «embedded strings» without escapes»

The only time that doesn't work is if you want to embed a quote character as a character rather than as a string delimiter. But that is extremely rare.

There are also “different styles” of balanced quotes to choose from, so you can embed a quote character of one style inside a string delimited by a different style.

There will always be perverse situations where a backslash is needed. But you can make them much less common with balanced quotes.

PostgreSQL allows dollar quoted strings. $whoohoo$this is a string $whoohoo$. A really good way to include strings in strings as the tag can be almost anything you want. I think it is more flexible than heredoc and friends.

https://www.postgresql.org/docs/9.0/static/sql-syntax-lexica...

I agree, but even there you can have problems if you want a string containing a newline or tab character!