TextConversions Type
Conversions from string to string/int/int64/decimal/float/boolean/datetime/timespan/guid options
Static members
| Static member |
Description
|
Full Usage:
TextConversions.AsBoolean(text)
Parameters:
string
-
The string to parse.
Returns: bool option
|
Attempts to parse the string as a boolean. Accepts "true", "false", "yes", "no", "1", "0" (case-insensitive).
|
Full Usage:
TextConversions.AsDateTime(cultureInfo) (text)
Parameters:
IFormatProvider
-
The culture to use for parsing.
text : string
-
The string to parse. Accepts e.g. 2013-01-28T00:37Z or /Date(1234567890)/.
Returns: DateTime option
|
Attempts to parse the string as a DateTime using ISO 8601 format or MSFT JSON date format.
|
Full Usage:
TextConversions.AsDateTimeOffset(cultureInfo) (text)
Parameters:
IFormatProvider
-
The culture to use for parsing.
text : string
-
The string to parse. The timezone offset must be present.
Returns: DateTimeOffset option
|
Attempts to parse the string as a DateTimeOffset using ISO 8601 format or MSFT JSON date with offset.
|
Full Usage:
TextConversions.AsDecimal(cultureInfo) (text)
Parameters:
IFormatProvider
-
The culture to use for parsing.
text : string
-
The string to parse. Currency and percentage adorners are removed before parsing.
Returns: decimal option
|
Attempts to parse the string as a decimal using the given culture.
|
Full Usage:
TextConversions.AsFloat(missingValues) (useNoneForMissingValues) (cultureInfo) (text)
Parameters:
string[]
-
Values to treat as missing. If matched, returns None or Some NaN depending on useNoneForMissingValues.
useNoneForMissingValues : bool
-
If true, missing values and NaN are returned as None; otherwise Some Double.NaN is used.
cultureInfo : IFormatProvider
-
The culture to use for parsing.
text : string
-
The string to parse.
Returns: float option
|
Attempts to parse the string as a float using the given culture.
|
Full Usage:
TextConversions.AsGuid(text)
Parameters:
string
-
The string to parse. Leading and trailing whitespace is trimmed before parsing.
Returns: Guid option
|
Attempts to parse the string as a Guid.
|
Full Usage:
TextConversions.AsInteger(cultureInfo) (text)
Parameters:
IFormatProvider
-
The culture to use for parsing.
text : string
-
The string to parse. Currency and percentage adorners are removed before parsing.
Returns: int option
|
Attempts to parse the string as an integer using the given culture.
|
Full Usage:
TextConversions.AsInteger64(cultureInfo) (text)
Parameters:
IFormatProvider
-
The culture to use for parsing.
text : string
-
The string to parse. Currency and percentage adorners are removed before parsing.
Returns: int64 option
|
Attempts to parse the string as a 64-bit integer using the given culture.
|
Full Usage:
TextConversions.AsString(str)
Parameters:
string
Returns: string option
|
Turns empty or null string value into None, otherwise returns Some
|
Full Usage:
TextConversions.AsTimeSpan(cultureInfo) (text)
Parameters:
CultureInfo
-
The culture to use for parsing.
text : string
-
The string to parse.
Returns: TimeSpan option
|
Attempts to parse the string as a TimeSpan using the given culture.
|
|
`¤` `$` `¢` `£` `¥` `₱` `﷼` `₤` `₭` `₦` `₨` `₩` `₮` `€` `฿` `₡` `៛` `؋` `₴` `₪` `₫` `₹` `ƒ`
|
Full Usage:
TextConversions.DefaultMissingValues
Returns: string[]
|
`NaN` `NA` `N/A` `#N/A` `:` `-` `TBA` `TBD`
|
|
`%` `‰` `‱`
|
FSharp.Data