1

How do I format an arduino String when I do not want to print it? I know that one can use printf() or other methods to print a formated string and unfortunately that's all I find with google. But that's explicitly not what I'm looking for, I want to assign the formated string to a variable instead. There are itoa, etc. which I could use, but if there is a standard function to use like String a=format("an integer: %i",myinteger); I would really prefer this one.

  • The answers to the below question link might help - stackoverflow.com/questions/34775168/… – Rohan Mar 16 at 2:49
  • see Rohan's link for sprintf. I recommend not to use Strings, but if you must: String s(32); s += "an integer: "; s += myinteger; – Juraj Mar 16 at 6:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.