Jump to content

string format func


photo

Recommended Posts

image.thumb.png.de5ea3adfda698150fdf87b6643d6a79.png

Isn't this function applied directly to the String variable?

 

Although it applies when used like this,

String ex;

ex = ex.format(" value %d", 3);

 

but, Are there any format functions that apply right away?
Like CString's Format.

 

As a result of the tests, it seems to be applied when using the printf function.

Edited by dongju.jeong
Link to comment

it work like spritf

String ex = String::format(" value %d", 3); // "value 3"
//or
const char *m = String::format("value float %.2f", 12.342532f).get(); //"value float 12.34"

its static method, you can call it without instance

  • Like 1
Link to comment
×
×
  • Create New...