System::Char::TryParse 方法

Char::TryParse method

尝试将仅包含单个字符的字符串转换为 UTF-16 字符。仅当输入字符串非空且长度恰好为一个字符时,函数才会成功。

static bool System::Char::TryParse(const System::String &s, char_t &result)
参数类型描述
sconst System::String&String 用于转换
resultchar_t&如果转换成功,将包含转换结果的输出变量

ReturnValue

如果转换成功,则返回 true,否则返回 false

另见