System.WideString.from_string
C++
bool from_string(const WideString &str, bool &value);
bool from_string(const WideString &str, Extended &value);
bool from_string(const WideString &str, const Sysutils::TFormatSettings &settings, Extended &value);
bool from_string(const WideString &str, int &value);
bool from_string(const WideString &str, long long &value);
bool from_string(const WideString &str, unsigned int &value);
bool from_string(const WideString &str, unsigned long long &value);
bool from_string(const WideString &str, TDateTime &value);
bool from_string(const WideString &str, const Sysutils::TFormatSettings &settings, TDateTime &value);
bool from_string(const WideString &str, Currency &value);
bool from_string(const WideString &str, const Sysutils::TFormatSettings &settings, Currency &value);
bool from_string(const WideString &str, unsigned long long &value);
Properties
| Type | Visibility | Source | Unit | Parent | 
|---|---|---|---|---|
| function | public | wstring.h | System | WideString | 
Description
Converts from an WideString 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 a WideString 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: 
 WideString str = "100ABC";
 int i;
 from_string(str, i);
 // In this case: i == 100