Using an Arduino. I have this code to read a file line by line as a string. This string is then inserted into an http url string. Here is the code. All of this except 'File.....' and 'String addr1' go inside the loop
String addr1 = "https://docs.google.com/forms/.......................14=happy";
String sd_data;
File testfile; // these parts come before void setup()
testfile = SD.open("testdata.txt", FILE_READ); //goes in the loop
while (testfile.available()) {
sd_data = testfile.readStringUntil('\n');
sd_data.replace(' ', '+'); // replace spaces with +
addr1.replace('happy', sd_data);
}
I get this error converting to 'const String' from initializer list would use explicit constructor 'String::String(int, unsigned char)'
'happy'or"happy"? - Bo Persson'happy'is an integer. Certainly code should be using a string"happy"- somehow. - chux - Reinstate Monicasd_data.replace(' ', '+');is wrong? @chux - Noel DSouza' 'and'+'arechar. Uncertain about Arduino replace(). - chux - Reinstate Monica