Multi-Line Comments in Ruby?
This is how it looks (via screenshot) – otherwise it’s hard to interpret how the above comments will look. Click to Zoom-in:
This is how it looks (via screenshot) – otherwise it’s hard to interpret how the above comments will look. Click to Zoom-in:
You can use a space followed by the grave accent (backtick): However, this is only ever necessary in such cases as shown above. Usually you get automatic line continuation when a command cannot syntactically be complete at that point. This includes starting a new pipeline element: will work without problems since after the | the … Read more
It depends on the language, but there should be a modifier that you can add to the regex pattern. In PHP it is: The s at the end causes the dot to match all characters including newlines.
This is how it looks (via screenshot) – otherwise it’s hard to interpret how the above comments will look. Click to Zoom-in:
‘@ should be first thing in the line or it is considered to be just a part of the string. This approach also works with @”/”@
Are you talking about multi-line strings? Easy, use triple quotes to start and end them. You can use single quotes too (3 of them of course at start and end) and treat the resulting string s just like any other string. NOTE: Just as with any string, anything between the starting and ending quotes becomes part of … Read more
JSON does not allow real line-breaks. You need to replace all the line breaks with \n. eg: “first line second line” can saved with: “first line\nsecond line” Note: for Python, this should be written as: “first line\\nsecond line” where \\ is for escaping the backslash, otherwise python will treat \n as the control character “new line”
Is it possible to have multi-line strings in JSON? It’s mostly for visual comfort so I suppose I can just turn word wrap on in my editor, but I’m just kinda curious. I’m writing some data files in JSON format and would like to have some really long string values split over multiple lines. Using … Read more
Update: ECMAScript 6 (ES6) introduces a new type of literal, namely template literals. They have many features, variable interpolation among others, but most importantly for this question, they can be multiline. A template literal is delimited by backticks: (Note: I’m not advocating to use HTML in strings) Browser support is OK, but you can use transpilers to be more … Read more
Update: ECMAScript 6 (ES6) introduces a new type of literal, namely template literals. They have many features, variable interpolation among others, but most importantly for this question, they can be multiline. A template literal is delimited by backticks: (Note: I’m not advocating to use HTML in strings) Browser support is OK, but you can use … Read more