S
S
Sencis2019-04-06 01:56:24
C++ / C#
Sencis, 2019-04-06 01:56:24

How to insert quotes in a string?

The GSM modem needs to send the command: "AT+CSCS="GSM"" while it is impossible to send GSM in quotation marks . If you send it like this: "AT+CSCS=\"GSM\"" then a slash \ is also sent, an error occurs. If done differently: QString c = "0"; c[0] = 34; or char = "34"; then slashes are added to the string where this character will be used: " \ " How can you send quotes in the string without " \ " ?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sencis, 2019-04-06
@Userpc0101

On the nth try it worked "AT+CSCS=\"GSM\"\r" or rather after cleaning the folder with the built project.

V
vanyamba-electronics, 2019-04-06
@vanyamba-electronics

"\""

A
Anton Kokarev, 2019-04-06
@akokarev

enclose the whole expression in single quotes
Alternatively, use a backslash
Well, for the most appropriate answer, tell us what programming language are you talking about?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question