Questions tagged [double-quotes]

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

1212 questions
6
votes
3 answers

How to avoid double quote escape in C# strings?

In Ruby it's possible to use the strings without the need to escape the double quote in the string, like Q/Some my string with "double quotes"/ Is it possible with C# to use a string without a need to escape double quotes? For a good reason I need…
Zelid
  • 6,905
  • 11
  • 52
  • 76
6
votes
1 answer

CSV remove field value wrap quotes

I'm attempting to write a list to a csv, however when I do so I get wrapper quotes around my field values: number1,number2 "1234,2345" "1235.7890" "2345.5687" Using this code: with open('C:\\temp\\test.csv', 'wb') as out_file: ... csv_writer =…
artwork21
  • 330
  • 12
  • 29
5
votes
3 answers

Accommodate two types of quotes in a regex

I am using a regex to replace quotes within in an input string. My data contains two 'types' of quotes - " and “ There's a very subtle difference between the two. Currently, I am explicitly mentioning both these types in my regex \"*\“* I am…
Dexter
  • 11,311
  • 11
  • 45
  • 61
5
votes
3 answers

Python CSV module - quotes go missing

I have a CSV file that has data like this 15,"I",2,41301888,"BYRNESS RAW","","BYRNESS VILLAGE","NORTHUMBERLAND","ENG" 11,"I",3,41350101,2,2935,2,2008-01-09,1,8,0,2003-02-01,,2009-12-22,2003-02-11,377016.00,601912.00,377105.00,602354.00,10 I am…
tjmgis
  • 1,589
  • 4
  • 23
  • 42
5
votes
4 answers

Oracle SQL Syntax: Quoted identifier

I encountered SQL queries that looked like select "hello" from "foo"."bar" I found that we can have quoted and unquoted identifiers in Oracle: Database Object Names and Qualifiers ... A quoted identifier begins and ends with double quotation…
Will
  • 2,858
  • 6
  • 33
  • 50
5
votes
2 answers

In code editor of IntelliJ, wrap selected text in double-quote marks

In the code editor for IntelliJ 2019, I want to add a straight double-quote (QUOTATION MARK) to the currently-selected text to make it a string literal. Is there some keystroke or menu item to make this happen?
Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
5
votes
6 answers

remove double quotes from a string in c++

I am stripping off double quotes from a string, but I keep getting this error from the following function. What is the problem here? void readCSVCell(stringstream& lineStream, string& s) { std::getline(lineStream,s,','); s.erase(remove(…
user236215
  • 7,278
  • 23
  • 59
  • 87
5
votes
1 answer

SHELL add double quotes at the beginning and end of specific variable

I have variable in shell script which takes a value in variable $var1. If I do echo $var1 I will get for example value Boston. My desired value is "Boston" I tried couple of cases: var1=""$var1"" var1="""$var1""" But in both cases I am getting as…
Veljko
  • 1,708
  • 12
  • 40
  • 80
5
votes
4 answers

Python - How to append double quotes to a string and store as new string?

I am using Python 2.6+ and would like to append double quotes to a string and store it as a new string variable. I do not want to print it but use it later in my python script. For example: a = 'apple' b = some_function(a) --> b would be equal to…
activelearner
  • 7,055
  • 20
  • 53
  • 94
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
3 answers

PHP array_map trim + parameters

I'm using array_map to trim all my array values but I need to pass a third parameter because I need to more than just trim whitespaces so I'm passing in a third parameter. Basically I want to trim all array values of whitespaces, single quotes, and…
dokgu
  • 4,957
  • 3
  • 39
  • 77
5
votes
1 answer

How to match double quotes using grep

I thought I knew this(or at least how to google for it)! But I can't figure out how to match double quotes using grep when searching for patterns in text file. I tried to escape the double quotes symbol with a backslash, but it doesn't seem to…
Shamanth Huddar
  • 53
  • 1
  • 1
  • 4
5
votes
3 answers

C++ CSV line with commas and strings within double quotes

I'm reading a CSV file in C++ and the row format is as such: "Primary, Secondary, Third", "Primary", , "Secondary", 18, 4, 0, 0, 0 (notice the empty value) When I do: while (std::getline(ss, csvElement, ',')) { …
dimxasnewfrozen
  • 127
  • 1
  • 13
5
votes
2 answers

csv writer puts quotes around each row

I'm trying to merge multiple csv files with the same format into one. merge_list = glob.glob(gndlbsum+"*gndlbsum.csv") filewriter_lbsum = target_dir+"gndlbsum_master.csv" #get the list of csv files and set the output file counter=0 for file in…
quickshare
  • 155
  • 4
  • 13
5
votes
6 answers

Escape double quotes in a C# string

I'm trying to escape \ and " in my string like this: text.Replace("\\", "\\\\").Replace("\"", "\\\""); But the result for text, arash "moeen" turns out as arash \\\"moeen\\\" How can I fix this?
arash moeen
  • 4,533
  • 9
  • 40
  • 85