system
1
Hello! I have a little issue dealing with strings. inString has been declared as string and I am using WString.h library..
I should replace all the + with blanks.. now that's what I try:
inString.replace(char * ("+"),char * (" "));
And I get this in return
error: expected primary-expression before 'char'
:-?
Any suggestions?
system
2
Try this:
inString.replace("+", " ");
system
3
Good Morning!
I've tried that too.. no success
inString.replace("+", " ");
In function 'void loop()':
error: invalid conversion from 'const char*' to 'char
:-/
the weird part is that these are working fine..
String text ="";
..
..
int Start = inString.indexOf("t");
int End = inString.indexOf("H");
text = inString.substring((Start+2), (End-1));
system
4
Looking at the error, it expects a const char *. It is c++or like c++.. const is meaning that the value is not changeable.
So try this:
inString.replace(const char * ("+"),const char * (" "));
inString.replace("+", " ");
In function 'void loop()':
error: invalid conversion from 'const char*' to 'char
suggests to me that
inString.replace('+', ' ');
should do the trick.