Chat freely about anything...

User avatar
By ac21
#23378 When you send info to a ESP what dose the backward slash mean? for instance...
normally one would send

Code: Select allAT+CIPSTART=4,”TCP”,”www.google.com”,80


but when sending from a arduino

Code: Select all     String cmd = "AT+CIPSTART=\"TCP\",\"";
     cmd += DST_IP;
     cmd += "\",80";
     Serial2.println(cmd);
User avatar
By kolban
#23380 In C programming, a string is a sequence of characters that are enclosed in double quotes for example:

String myVar = "hello world";

but what if you want your string to include the double quote character?

String myVar = "hello "world"";

will not work as the compiler isn't sure where the boundaries of the string are to be found. However, if you wish to include "special" characters such as the double quote within a string, you can prefix them with a "\" (backslash) character. This tells the compiler that what ever comes next is to be inserted into the string exactly as is. If you need to insert a backslash, simply insert "\\". The use of the backslash is called "escaping".

The following will work:

String myVar="hello \"world\"";