wiki:Docs/Prog/Manual/ApplicationLibraries/lib825ev/String/StrFmt

Version 2 (modified by Don Wilson, 14 years ago) ( diff )

--

StrFmt

Convert string to floating point number

string StrFmt(const char* pszFmt, ...);

Parameters

  • pszFmt - character array of formatting information
  • ... - variable number of parameters to fill in formatting specifiers

Return Value

  • Returns the formatted string

Remarks

This is basically a wrapper around sprintf to provide the flexibility of formatting with some safety measures built in. If string parameters are used the ".c_str()" method will be needed to convert this to C style strings. Refer to http://www.cplusplus.com/reference/clibrary/cstdio/printf/ for formatting specifiers.

Example

string strMsg;
strID = "123";
strMsg = StrFmt("ID: %s", strID.c_str());

See Also

Note: See TracWiki for help on using the wiki.