Class ParseAssistant
Contains methods for cross-platform primitive parsing from strings.
Inheritance
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class ParseAssistant : object
Methods
ParseBooleanValue(String)
Parses a boolean value from a string.
Declaration
public static bool ParseBooleanValue(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
Returns
Type | Description |
---|---|
System.Boolean | The parsed boolean value. |
ParseByteValue(String)
Parses a byte value from a string.
Declaration
public static byte ParseByteValue(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
Returns
Type | Description |
---|---|
System.Byte | The parsed byte value. |
ParseDecimalValue(String)
Parses a decimal value from a string.
Declaration
public static decimal ParseDecimalValue(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
Returns
Type | Description |
---|---|
System.Decimal | The parsed decimal value. |
ParseDoubleValue(String)
Parses a double value from a string.
Declaration
public static double ParseDoubleValue(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
Returns
Type | Description |
---|---|
System.Double | The parsed double value. |
ParseFloatValue(String)
Parses a float value from a string.
Declaration
public static float ParseFloatValue(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
Returns
Type | Description |
---|---|
System.Single | The parsed float value. |
ParseGuidValue(String)
Parses a GUID value from a string.
Declaration
public static Guid ParseGuidValue(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
Returns
Type | Description |
---|---|
Guid | The parsed GUID value. |
ParseIntegerValue(String)
Parses an integer value from a string.
Declaration
public static int ParseIntegerValue(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
Returns
Type | Description |
---|---|
System.Int32 | The parsed integer value. |
ParseLongValue(String)
Parses a long value from a string.
Declaration
public static long ParseLongValue(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
Returns
Type | Description |
---|---|
System.Int64 | The parsed long value. |
ParseShortValue(String)
Parses a short value from a string.
Declaration
public static short ParseShortValue(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
Returns
Type | Description |
---|---|
System.Int16 | The parsed short value. |
TryParseBooleanValue(String, out Boolean)
Attempts to parse a boolean value from a string.
Declaration
public static bool TryParseBooleanValue(string s, out bool boolResult)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
System.Boolean | boolResult | The parsed boolean value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryParseByteValue(String, out Byte)
Attempts to parse a byte value from a string.
Declaration
public static bool TryParseByteValue(string s, out byte byteResult)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
System.Byte | byteResult | The parsed byte value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryParseDecimalValue(String, out Decimal)
Attempts to parse a decimal value from a string.
Declaration
public static bool TryParseDecimalValue(string s, out decimal decimalResult)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
System.Decimal | decimalResult | The parsed decimal value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryParseDoubleValue(String, out Double)
Attempts to parse a double value from a string.
Declaration
public static bool TryParseDoubleValue(string s, out double doubleResult)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
System.Double | doubleResult | The parsed double value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryParseFloatValue(String, out Single)
Attempts to parse a float value from a string.
Declaration
public static bool TryParseFloatValue(string s, out float floatResult)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
System.Single | floatResult | The parsed float value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryParseGuidValue(String, out Guid)
Attempts to parse a GUID value from a string.
Declaration
public static bool TryParseGuidValue(string s, out Guid guidResult)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
Guid | guidResult | The parsed GUID value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryParseIntegerValue(String, out Int32)
Attempts to parse an integer value from a string.
Declaration
public static bool TryParseIntegerValue(string s, out int intResult)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
System.Int32 | intResult | The parsed integer value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryParseLongValue(String, out Int64)
Attempts to parse a long value from a string.
Declaration
public static bool TryParseLongValue(string s, out long longResult)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
System.Int64 | longResult | The parsed long value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryParseShortValue(String, out Int16)
Attempts to parse a short value from a string.
Declaration
public static bool TryParseShortValue(string s, out short shortResult)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string. |
System.Int16 | shortResult | The parsed short value. |
Returns
Type | Description |
---|---|
System.Boolean |
|