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.

asked Mar 16, 2019 at 2:37
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

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.