Literals/String: Difference between revisions

Content deleted Content added
added J
Added Haskell example
Line 85:
// assigns value 'hello' to str
auto str = x"68 65 6c 6c 6f";
 
=={{header|Haskell}}==
 
Characters use single quotes, strings use double quotes. Both allow Unicode. Escape sequences start with a backslash. There are no verbatim strings, no here-strings, and no expansion of variables in strings.
 
=={{header|IDL}}==
 
The single and double quotes are fairly interchangeable allowing one to use whichever isn't to be quoted (though single-qotesquotes seem more well-behaved around integers in strings). Thus the following are both valid character-constant assignments:
 
a = " that's a string "