C++ Builder 参考手册 ➙ System::Sysutils ➙ FmtStr
格式化数据到字符串
头文件:#include <System.SysUtils.hpp>
命名空间:System::Sysutils
函数原型:
void __fastcall FmtStr(
System::UnicodeString &Result,
const System::UnicodeString Format,
const System::TVarRec *Args,
const int Args_High);
void __fastcall FmtStr(
System::UnicodeString &Result,
const System::UnicodeString Format,
const System::TVarRec *Args,
const int Args_High,
const TFormatSettings &AFormatSettings);
参数:
- Result:用于返回生成的字符串;
- Format:输出数据的格式;
- Args:要输出的数据数组;
- Args_High:数据的个数减1;
- AFormatSettings:地区格式;
返回值:
- 按照 Format 参数的格式输出参数 Args 数据到字符串,通过参数 Result 返回生成的字符串;
- 这个函数的参数及生成的字符串规则和 Format 函数相同。
- 没有 AFormatSettings 参数的函数不是线程安全的,因为使用了全局变量作为地区格式;带有 AFormatSettings 参数的函数是线程安全的。
相关:
- System::Sysutils::Format
- System::Sysutils::FormatBuf
- System::Sysutils::FormatCurr
- System::Sysutils::FormatDateTime
- System::Sysutils::FormatFloat
- System::Sysutils::FmtStr
- System::Sysutils::FmtLoadStr
- System::Sysutils::StrFmt
- System::Sysutils::StrLFmt
- System::Sysutils::WideFormat
- System::Sysutils::WideFormatBuf
- System::Sysutils::WideFmtStr
- System::Sysutils
- std::printf, std::_tprintf, std::wprintf
- std::sprintf, std::_stprintf, std::swprintf
- std::vprintf, std::_vtprintf, std::vwprintf
- std::vsprintf, std::_vstprintf, std::vswprintf
- std::snprintf, std::_sntprintf, std::snwprintf
- std::vsnprintf, std::_vsntprintf, std::vsnwprintf
- <cstdio>
C++ Builder 参考手册 ➙ System::Sysutils ➙ FmtStr