Answer the question
In order to leave comments, you need to log in
How to put the value of a variable inside a string?
There is a library with a method that takes a string as an argument:
String timeNow = time.gettime("h:m:s");
// возвращает строку со значением времени как в указанной маске, к примеру "03:57:29"
String var = "h:m:s";
String timeNow = time.gettime(var);
String var = "h:m:s";
String timeNow = time.gettime("" + var + "");
Answer the question
In order to leave comments, you need to log in
Thank you Vladimir
String var = "h:m:s";
String timeNow = time.gettime(var.c_str());
const char timeFormat[] = "h:m:s";
String timeNow = time.gettime(timeFormat);
String timeFormat = "h:m:s";
String timeNow = time.gettime((const char*) timeFormat);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question