C++ Builder 參考手冊(cè) ? System::Sysutils ? TryStrToUInt
字符串轉(zhuǎn)無(wú)符號(hào)整數(shù)值
頭文件:#include <System.SysUtils.hpp>
命名空間:System::Sysutils
函數(shù)原型:
bool __fastcall TryStrToUInt(const System::UnicodeString S, unsigned &Value);
參數(shù):
- S:字符串唱较;
- Value:返回?zé)o符號(hào)整數(shù)轉(zhuǎn)換結(jié)果琅绅;
返回值:
- true:通過(guò)參數(shù) Value 返回?zé)o符號(hào)整數(shù)類(lèi)型數(shù)值;
- false:轉(zhuǎn)換失旚岬铡臀突;
- 字符串可以是十進(jìn)制或十六進(jìn)制數(shù)據(jù):以 "0x" 開(kāi)頭認(rèn)為是十六進(jìn)制數(shù)據(jù)勉抓,否則認(rèn)為是十進(jìn)制,不支持八進(jìn)制及其他進(jìn)制候学;
- 函數(shù) StrToUInt藕筋、StrToUIntDef 和 TryStrToUInt 的區(qū)別:
? StrToUInt 轉(zhuǎn)換失敗拋出 EConvertError 異常;
? StrToUIntDef 轉(zhuǎn)換失敗返回默認(rèn)值梳码;
? TryStrToUInt 轉(zhuǎn)換結(jié)果通過(guò)參數(shù)返回隐圾,函數(shù)返回值返回是否轉(zhuǎn)換成功伍掀。
相關(guān):
- System::Sysutils::IntToStr
- System::Sysutils::IntToHex
- System::Sysutils::UIntToStr
- System::Sysutils::Format
- System::Sysutils::FormatBuf
- System::Sysutils::StrToBool
- System::Sysutils::StrToBoolDef
- System::Sysutils::StrToCurr
- System::Sysutils::StrToCurrDef
- System::Sysutils::StrToDate
- System::Sysutils::StrToDateDef
- System::Sysutils::StrToDateTime
- System::Sysutils::StrToDateTimeDef
- System::Sysutils::StrToFloat
- System::Sysutils::StrToFloatDef
- System::Sysutils::StrToInt
- System::Sysutils::StrToIntDef
- System::Sysutils::StrToInt64
- System::Sysutils::StrToInt64Def
- System::Sysutils::StrToTime
- System::Sysutils::StrToTimeDef
- System::Sysutils::StrToUInt
- System::Sysutils::StrToUIntDef
- System::Sysutils::StrToUInt64
- System::Sysutils::StrToUInt64Def
- System::Sysutils::TimeToStr
- System::Sysutils::TryStrToBool
- System::Sysutils::TryStrToCurr
- System::Sysutils::TryStrToDate
- System::Sysutils::TryStrToDateTime
- System::Sysutils::TryStrToFloat
- System::Sysutils::TryStrToInt
- System::Sysutils::TryStrToInt64
- System::Sysutils::TryStrToTime
- System::Sysutils::TryStrToUInt
- System::Sysutils::TryStrToUInt64
- System::Sysutils
- std::atof, std::_ttof, std::_wtof
- std::_atold, std::_ttold, std::_wtold
- std::atoi, std::_ttoi, std::_wtoi
- std::atol, std::_ttol, std::_wtol
- std::atoll, std::_ttoll, std::_wtoll
- std::_atoi64, std::_ttoi64, std::_wtoi64
- std::strtof, std::_tcstof, std::wcstof
- std::strtod, std::_tcstod, std::wcstod
- std::strtold, std::wcstold, std::_strtold, std::_tcstold, std::_wcstold
- std::strtol, std::_tcstol, std::wcstol
- std::strtoll, std::_tcstoll, std::wcstoll
- std::strtoul, std::_tcstoul, std::wcstoul
- std::strtoull, std::_tcstoull, std::wcstoull
- <cstdlib>
C++ Builder 參考手冊(cè) ? System::Sysutils ? TryStrToUInt