Changes between Initial Version and Version 1 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/String/StrFmtLen


Ignore:
Timestamp:
10/24/11 10:41:46 (13 years ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/Prog/Manual/ApplicationLibraries/lib825ev/String/StrFmtLen

    v1 v1  
     1= StrFmtLen =
     2Format a string with a format specifier and a variable number of parameters.
     3
     4{{{
     5string StrFmtLen(int nLen, const char* pszFmt, ...);
     6}}}
     7
     8== Parameters ==
     9
     10 * nLen - length to make the generated output string
     11 * pszFmt - character array of formatting information
     12 * ... - variable number of parameters to fill in formatting specifiers
     13
     14== Return Value ==
     15
     16 * Returns the formatted string
     17
     18== Remarks ==
     19
     20This is similar to StrFmt but with the added length parameter. If the output string would be shorter than the specified length the output is padded with spaces to the right to make the string the desired length. If the output string would be longer than the specified length the output is truncated. 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.
     21
     22== Example ==
     23
     24{{{
     25int nVal = 123;
     26string strID = "ABC";
     27
     28string strMsg;
     29strMsg = StrFmtLen(40, "Number: %d ID: %s", nVal, strID.c_str());
     30}}}
     31
     32
     33== See Also ==
     34
     35 * [http://tech.825spectrum.com/trac/wiki/Docs/Prog/Manual/ApplicationLibraries/lib825ev/String/StrFmt StrFmt]
     36 * [http://tech.825spectrum.com/trac/wiki/Docs/Prog/Manual/ApplicationLibraries/lib825ev/String/StrToInt StrToInt]
     37 * [http://tech.825spectrum.com/trac/wiki/Docs/Prog/Manual/ApplicationLibraries/lib825ev/String/StrToFloat StrToFloat]