Questions related to the use of single-quotes in different programming languages.
Questions tagged [single-quotes]
352 questions
1338
votes
14 answers
How do I escape a single quote in SQL Server?
I am trying to insert some text data into a table in SQL Server 9.
The text includes a single quote '.
How do I escape that?
I tried using two single quotes, but it threw me some errors.
eg. insert into my_table values('hi, my name''s tim.');

tim_wonil
- 14,970
- 6
- 29
- 42
873
votes
7 answers
Difference between single and double quotes in Bash
In Bash, what are the differences between single quotes ('') and double quotes ("")?

jrdioko
- 32,230
- 28
- 81
- 120
436
votes
11 answers
Usage of the backtick character (`) in JavaScript
In JavaScript, a backtick† seems to work the same as a single quote. For instance, I can use a backtick to define a string like this:
var s = `abc`;
Is there a way in which the behavior of the backtick actually differs from that of a single…

vancewang
- 5,120
- 3
- 15
- 14
219
votes
7 answers
Double vs single quotes
Is there a specific time when I should use "" vs ''?
I've been using single quotes most of the time because it's easier to type but I'm not sure if I should.
e.g. get 'user/new' vs. get "user/new"

imjp
- 6,495
- 10
- 48
- 58
95
votes
3 answers
How does the leading dollar sign affect single quotes in Bash?
I need to pass a string to a program as its argument from the Bash CLI, e.g
program "don't do this"
The string may include any character like '$', '\', etc. and I don't want Bash to do any modification. So I think about using single quotes.
However…

user1206899
- 1,564
- 1
- 11
- 15
44
votes
4 answers
Are double "" and single '' quotes (always) interchangeable in R?
This is perhaps rather a minor question...
but just a moment ago I was looking through some code I had written and noticed that I tend to just use ="something" and ='something_else' completely interchangeably, often in the same function.
So my…

Stephen Henderson
- 6,340
- 3
- 27
- 33
32
votes
7 answers
How to Insert Double or Single Quotes
I have a long list of names that I need to have quotes around (it can be double or single quotes) and I have about 8,000 of them. I have them in Excel without any quotes and I can copy all of the names and paste them no problem but there are still…

three3
- 2,756
- 14
- 57
- 85
19
votes
1 answer
Single quote in JSON field POSTGRESQL
I am trying to manipulate a JSON with a single quote inside, and I am having some troubles:
1.- When I have a function, I cant pass as parameter a JSON string with a single quote inside:
This is the function:
CREATE OR REPLACE FUNCTION…

Za7pi
- 1,338
- 7
- 22
- 33
19
votes
1 answer
Should I use single or double quotes in my .vimrc file?
What’s the difference between single (') and double (") quotes in Vim? Does it make speed differences? Is it better to use one or another when running functions inside it? Does it matter at all?
I’m interested specifically in their use in the .vimrc…

greduan
- 4,770
- 6
- 45
- 73
13
votes
1 answer
Stopping Pandoc from escaping single quotes when converting from HTML to Markdown
If I convert a single quote ' from HTML to Markdown, it is automatically escaped:
% echo "'" | pandoc -f html -t markdown
\'
I'd like it to output without the slash, as it makes text with contractions rather much harder to read.
I thought this…

kdannyob
- 172
- 1
- 7
12
votes
4 answers
How can I accommodate a string with both single and double quotes inside of it in JavaScript
I have an application, and it is fed some HTML. It then needs to put that HTML into a string. This HTML contains single and double quotes. Is it possible, in javascript, to declare a string with information inside of it, that does not use single or…

swickblade
- 4,506
- 5
- 21
- 24
11
votes
6 answers
Escaping single quotes in REDSHIFT SQL
I've lots of string values containing single quotes which I need to insert to a column in REDSHIFT table.
I used both /' and '' to escape the single quote in INSERT statement.
e.g.
INSERT INTO table_Temp
VALUES ('1234', 'O\'Niel'), ('3456',…

stack_pointer is EXTINCT
- 2,263
- 12
- 49
- 59
11
votes
5 answers
Add single quotes to a string
I try to add single quotes to a string but don't see how to do it. For instance I would like to replace ABC by 'ABC'.
I have played with paste, cat, print but don't see how to do it.
Any solution?
Thanks,
Vincent

VincentH
- 1,009
- 4
- 13
- 24
10
votes
5 answers
Python how convert single quotes to double quotes to format as json string
I have a file where on each line I have text like this (representing cast of a film):
[{'cast_id': 23, 'character': "Roger 'Verbal' Kint", 'credit_id': '52fe4260c3a36847f8019af7', 'gender': 2, 'id': 1979, 'name': 'Kevin Spacey', 'order': 5,…

revy
- 3,945
- 7
- 40
- 85
7
votes
4 answers
Vue: Failed to compile (Strings must use singlequote)
I've been working with Visual Studio Code for two days now. I try to build a Vue-Application. But always when I run the application by npm run serve, I get the following errors:
9:9 error Strings must use singlequote quotes
9:15 error …

STh
- 746
- 9
- 24