3

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.

2
  • 1
    The answers to the below question link might help - stackoverflow.com/questions/34775168/… Commented Mar 16, 2019 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; Commented Mar 16, 2019 at 6:10

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.