Questions tagged [single-quotes]

Questions related to the use of single-quotes in different programming languages.

352 questions
-1
votes
2 answers

How to add apostrophe as allowed character to existing regular expression?

I have the following regular expression for one of my name fields in C# web app: ^[A-Za-zÀ-ſ0-9.,#&-/'_!@;]?[a-zA-ZÀ-ſ0-9 '#&-/.,_:!@;]*[A-Za-zÀ-ſ0-9.,#-/_!@;]$ How can I properly modify it to add apostrophe/single quote character (') as an allowed…
Tom S
  • 127
  • 1
  • 4
  • 18
-1
votes
4 answers

How to insert query into mysql with single quotes

I want to insert a query into a database which contain single quotes within the value. How can I handle this in PHP? My query is: insert into query (date_time, userid, user_traits, query_sql, status, description, is_scheduled_row) values…
Gugan Abu
  • 546
  • 1
  • 4
  • 17
-2
votes
1 answer

Saving html code to a database if the font family has double quotes?

I do a simple text editor. With the javascript select option I add font-family to innline-style and change the font-family style. After that I need to ajax-save the html in the mysql database. If font-family doesn't have duplicate quotes like Arial,…
borma
  • 1
  • 2
-2
votes
1 answer

How to include 2 single quotes in a variable in sql server

Below line is returning me the value with single quote. set @SearchStr2= upper(QUOTENAME('%''' + @SearchStr + '''%','''') )COLLATE SQL_Latin1_General_CP1_CS_AS; Actual Output : '%'NM'%' Expected Output : '%''NM''%' -- Need 2 single quotes before…
Indhu
  • 1
-2
votes
1 answer

Bash is adding extra single quote while running a command

While running the command through script, Bash is expanding TLS_CERT variable with extra single quotes, which is making my command to fail. I have put simplified code here for readable format Can anybody please suggest how to avoid…
Krohit
  • 1
-2
votes
1 answer

it's instead of it's in python string

My python string consists of ' instead of ' (single quotes). My current objective is to expand compound words like It's to It is, Haven't to Have not. "This has been great for me. I've been on it for 2 weeks and in the last week I only…
vignesh_md
  • 15
  • 12
-2
votes
4 answers

Is there a way to alternate single and double quotes in C# like you can in javascript?

In javascript I can write var s = 'He said "Hello" to me'; or var s = "don't be sad"; In other words, if I want a double quote in the string, I can declare the string using single quotes. If I want a single quote in the string, I can…
rocketsarefast
  • 4,072
  • 1
  • 24
  • 18
-2
votes
3 answers

remove quotes from output of python dictionaries

I am new to python and I am stuck in a situation here! I have stored strings in a python dictionary and when I try to extract it python is wrapping single quotes around the value and giving it back. How can I get rid of the single quotes? Example…
raman
  • 93
  • 2
  • 8
-2
votes
4 answers

how to convert single quotes string to number in python

I have a number of type string with single quotes. e,g var = '2,000' type(var) # I want to convert it to int. I have tried int(var) But it gives an error invalid literal for int() with base 10: '2,000'
keerthan kumar
  • 332
  • 7
  • 25
-2
votes
3 answers

php if then else statement syntax error somewhere

So I am getting the following parse error when this file loads: Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) I have tried…
Antistandard
  • 73
  • 1
  • 7
-2
votes
1 answer

Simple quote in variable in javascript

I would like to accept simple quotes into a string without crashing my curl request. here my curl request : curl -XGET "localhost:9200/test/all/_search?pretty" -d \'{"query":"'+question+'"}\''; If question = 'It's OK'. I will have an error durong…
onedkr
  • 3,226
  • 3
  • 21
  • 31
-2
votes
1 answer

Replace double consecutive single quotation mark

I'm trying to replace double consecutive single quotation marks to null, like this: //my string is " replace '' to null " str.Replace("''", "null"); //now my string is " replace null to null " But this is happening: //my string is " replace '' to…
fkupper
  • 520
  • 3
  • 9
-3
votes
1 answer

where clause without single quote in set?

I have a set statement. I am trying to add a where statement inside that. However, when I put a single quote, it is not executing. How to escape the single quote in where clause to execute the set statement? Below is my code: DECLARE @desttablename…
Sriram NR
  • 41
  • 5
-3
votes
1 answer

Use single quotes ( ' ) as a variable value

I recently installed qtile which is written and configured in python and I'm used to have a keybinding which includes single quotes '. This command is working : Keys = [ Key( ["mod4"], "m", …
ATR
  • 107
  • 6
-3
votes
1 answer

How to remove single quote and put double quotes in the array of objects in javascript

I want to remove single quotes and put double quotes in the array of objects in javascript. var arr=[{ email: 'abc@gmail.com', name: 'Abc' }, { email: 'def@hotmail.com', name: 'Dr.Def' }, { email: 'xyz@gmail.com', name: 'Xyz' }, …
1 2 3
23
24