160 questions
0 votes
1 answer
33 views
backslash count in raw string interpolation in scala
I am using Scala 3.3.7. When I do val str1 = raw"\\\" // compile error: unclosed string literal It is considering the \" as a single character. But when I do val str1 = raw"\\\\&...
0 votes
0 answers
91 views
How to turn off synchronous editing of raw string in Netbeans?
I'm using Netbeans 12 for C++ development with C++ plugin 1.5. I'm setting a string variable value to an svg, using a raw string literal. std::string variable = R"(<svg .... )"; It ...
2 votes
1 answer
266 views
Prevent new-line characters in a multiline raw string literal
How can I define raw string literal where the line breaks in the code are just for readability and there are no new-line characters (\r, \n) in the resulting string? Something like this: string str = ...
-1 votes
1 answer
48 views
Selective OS package error in Python (Windows 10) [duplicate]
I have an error where the os package seems to only be able to detect some folders and not others. My code is at the bottom; when I run it, I get the following outputs: "Bro reads", "It'...
1 vote
1 answer
141 views
What is the equivalent JavaScript syntax to Python's rawstring syntax r"" (instead of rf"")?
In Javascript, we can use the ES6 raw string String.raw`raw text` to form a raw string, but it uses the template string syntax at the same time. If I want to store the string "${a}\\${b}, with \\...
2 votes
1 answer
188 views
Syntax warning for escaped period in triple-quoted shell rule
I get the following warning: SyntaxWarning: invalid escape sequence '\.' when the following shell block is present in a rule: """ curl {params.ua} -L {params.url} \ ...
5 votes
1 answer
109 views
In JavaScript, is there a way to iterate over the lexical tokens of a string?
Given this string, which I receive from an endpoint: "\u0000\u0000\u0000\u001A%<some-random-text\fcdtoolHxxx1-34e3-4069-b97c-xxxxxxxxxxx\u001E\n" I would like to iterate the string to ...
2 votes
3 answers
512 views
How to store strings in variables, and then use those variables in other functions or methods in Python?
So I came across this simple problem of printing emojis in python. I assume there's multiple methods to do so, but these are the three major ones that I found:- Using UNICODE of the emoji Using CLDR ...
2 votes
2 answers
1k views
Include newline in one-line raw string literal?
Constructing a string for bulk posting for the purposes of Elasticsearch, I need to conform to a particular newline formatting. A raw string literal like this does the job: let json = format!(r#&...
2 votes
3 answers
278 views
how to preserve indent inside triple quote in C# 11?
In C#, using triple quotes ("""), how could I preserve the inner indentation of the second triple quotes? here it is a fiddle https://dotnetfiddle.net/ypP8Xp EDIT: This is only an ...
2 votes
2 answers
243 views
What is wrong in this code? I get a missing terminating '"' error always. Im new to C and wanted this ASCII for CS50x submissions
My program just doesn't work. I get this error. population/ $ make test test.c:6:9: error: missing terminating '"' character [-Werror,-Winvalid-pp-token] printf(R"EOF( ^ fatal error: ...
0 votes
0 answers
29 views
using os.path.join, but it's always doubling the '\' even putting it as rawstring [duplicate]
Im trying to use os.path.join, to open some dataframes, but it always says the \ fold even putting rawstring. when I create the "pattern_path" it works perfectly, and is only with a but ...
3 votes
1 answer
3k views
Make c# 11 raw string literals' newline use \r\n instead of \n
New C# 11 feature "raw string literals" seems to be using \n to break the line: const string text = """ "header1";"header2" "value1";&...
1 vote
1 answer
161 views
Python json.loads returning JSONDecodeError Expecting ',' delimiter
I am trying to parse a JSON raw string using json.loads but its throwing following error JSONDecodeError at /octopus/entries/53/test_sample_job/ Expecting ',' delimiter: line 3 column 27 (char 48) My ...
0 votes
0 answers
542 views
How do I add a variable to a raw string within a loop? [duplicate]
I have the following chunk of code: for i in range(len(files)): if files[i].split('^')[0]=='SequenceFile': number = files[i].split('^')[5] file = files[i].split('^')[2] ...