DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far...

Welcome! This is a Q&A website for computer programmers and users alike, focused on helping fellow programmers and users. Read more

What are you stuck on? Ask a question and hopefully somebody will be able to help you out!
0 votes

I would like to store a very long string that has many single and double quotes on a variable. Is there any way of doing this without the need to escape the single and double quotes?

edited by

Storing where?


On a variable

1 Answer

+1 vote
Best answer

Multiline strings var = """hello world""" (but you're still limited to 2 consecutive quotes max), or read the string from a file.

selected by
Contributions licensed under CC0