System.UnicodeString.from_string

From RAD Studio API Documentation
Jump to: navigation, search


C++

bool from_string(const UnicodeString &str, bool &value);
bool from_string(const UnicodeString &str, Extended &value);
bool from_string(const UnicodeString &str, const Sysutils::TFormatSettings &settings, Extended &value);
bool from_string(const UnicodeString &str, int &value);
bool from_string(const UnicodeString &str, long long &value);
bool from_string(const UnicodeString &str, unsigned int &value);
bool from_string(const UnicodeString &str, unsigned long long &value);
bool from_string(const UnicodeString &str, TDateTime &value);
bool from_string(const UnicodeString &str, const Sysutils::TFormatSettings &settings, TDateTime &value);
bool from_string(const UnicodeString &str, Currency &value);
bool from_string(const UnicodeString &str, const Sysutils::TFormatSettings &settings, Currency &value);
bool from_string(const UnicodeString &str, unsigned long long &value);

Properties

Type Visibility Source Unit Parent
function public ustring.h System UnicodeString

Description

Converts from an UnicodeString to other types, such as from a string to an integer.
Several methods have overloads to apply specific formatting when converting the string, which specifies the format the string uses and how to convert it. For example, you can convert from an UnicodeString to a Boolean, various sizes of signed and unsigned integers, floating-point types, and the special types Variant, TDateTime, and Currency.

The function converts all valid characters while ignoring the invalid ones, and in case there are no valid characters found the function returns false. Any leading spaces are ignored. The function´s base conversion assumes is 10 unless there is a leading x or 0x for which case the base is 16. See the example below:

 UnicodeString str = "100ABC";
 int i;
 from_string(str, i);
 // In this case: i == 100


See Also