Questions related to the use of single-quotes in different programming languages.
Questions tagged [single-quotes]
352 questions
7
votes
1 answer
Ruby on Rails, convert projectwide single quotes to double quotes
I wonder if anyone has come up with a shortcut to correctly convert ALL single quotes to double quotes in a new rails project. Thank you in advance. I would do that at the end of generating new project with a template.rb

webgen
- 183
- 1
- 6
7
votes
3 answers
RubyMine: key press to "convert to single quoted"?
Is there a keyboard shortcut to toggle between single quotes and double quotes in a Ruby code? Or a key I can set up to accept the Inspection Hint?
Thanks, M.

Martin Cleaver
- 909
- 8
- 21
7
votes
3 answers
Adding single quotes to a cell using VBA
I am trying to add single quotes to values in a column by using Chr(39), but I am only getting the second quote.
e.g. I want 'value' but I am getting value'
But if I use double quotes by using Chr(34) it works, and I get "value"
Sub AddQuote()
Dim…

Kiranshell
- 267
- 3
- 6
- 12
6
votes
2 answers
Performance: " or ' PHP
I'm working on a big project in php and I need to make sure it's all fast. So I'm wondering: what is faster to use, " or ' ? (Eg: $_SESSION['example'] or $_SESSION["example"])

Marnix Bouhuis
- 430
- 1
- 6
- 15
5
votes
1 answer
Don't escape single quotes with System.Text.Json
I would like .net core System.Text.Json to ignore the single quote character when escaping characters for serialization but I just can't get it to work:
var encoderSettings = new…

steb
- 436
- 3
- 12
5
votes
1 answer
Single quotes in a variable name in Perl?
I was writing some Perl code in vim and accidentally typed a single quote character in a variable name and noticed that it highlighted it in a different color than normal single quoted strings.
I thought that was odd, so I wrote a small test…

tjwrona1992
- 8,614
- 8
- 35
- 98
5
votes
0 answers
How to ignore quotes from being formatted by Prettier
I have a code base with both single and double quotes all over the place. When I format my TS files all the single quotes are being converted to double quotes. I want prettier to ignore considering both single and double quotes alone and do rest of…

Hariharan D
- 51
- 4
5
votes
1 answer
In R, why do style guides recommend that one only use double quotes?
The lintr package has a check for single-quoted strings, and single quotes are discouraged elsewhere (e.g. ?Quotes). Single and double quoted strings work identically in R, so is there a reason why single quotes are considered bad practice?…
user3603486
5
votes
5 answers
Why does single quote in Lisp always return upper case?
I'd like to be able to set case from a single quote, but that does not seem possible.
(format nil "The value is: ~a" 'foo)
"The value is: FOO"
(format nil "The value is: ~a" 'FOO)
"The value is: FOO"
(format nil "The value is: ~a" "Foo")
"The…

Jiminion
- 5,080
- 1
- 31
- 54
5
votes
1 answer
Spring message tag has troubles with the single quote character
I have 3 properties defined in my resource bundle:
test.key1 = Just a normal snippet.
test.key2 = snippet with {0} arguments {1}.
test.key3 = snippet with 'charac'ter'.
test.key4 = snippet with {0} arguments' and 'characters {1}.
Here's how I…

user1884155
- 3,616
- 4
- 55
- 108
4
votes
1 answer
Autochange Setting Double Quotes to Single Quotes in VSCode
i explored all over the topics and found out there is no answer for this question,
everyone is using search and replace, that's not the point.
we have to set the default value for attributes when completion is accepted.
I just found out how to…

Korosh Kiani
- 61
- 3
4
votes
1 answer
powershell: newline in a single-quoted string?
In powershell, double-quotes " indicate an "expandable" string, akin to "string interpolation" in other contexts. Single-quotes ' are strings which do not undergo interpolation.
I am a fan of this distinction, as it helps me anticipate how a…

orion elenzil
- 4,484
- 3
- 37
- 49
4
votes
3 answers
How to select an element that contains quote marks?
How can I use querySelector or any other Javascript selector when the element's attribute contains quote marks " ?
For example, if I search for an img element that has a src of http://www.example.com/abc"def (yes, an attribute that contains…

max
- 147
- 1
- 7
4
votes
4 answers
The difference between " and ' in Perl
According to this comment:
You also should not use single quotes in print ">>${ '_<$filename' }<<\n".
Instead try: print ">>${ \"_<$filename\" }<<\n"
I always thought that differences between " and ' are only that the string is interpreted or…

Eugen Konkov
- 22,193
- 17
- 108
- 158
4
votes
3 answers
Python Replace Single Quotes Except Apostrophes
I am performing the following operations on lists of words. I read lines in from a Project Gutenberg text file, split each line on spaces, perform general punctuation substitution, and then print each word and punctuation tag on its own line for…

mas
- 1,155
- 1
- 11
- 28