Conversion methods that return default values instead of throwing exceptions.
More...
|
static int | ToInt (string s) |
| Converts a string to an int.
|
|
static float | ToFloat (string s) |
| Converts a string to a float.
|
|
static string | ToSerializedElement (string s) |
| Sanitizes a string so it can be serialized to string-based serialization systems.
|
|
static string | FromSerializedElement (string s) |
| Desanitizes a string that was previously sanitized for use in string-based serialization systems.
|
|
Conversion methods that return default values instead of throwing exceptions.
◆ FromSerializedElement()
static string PixelCrushers.SafeConvert.FromSerializedElement |
( |
string |
s | ) |
|
|
inlinestatic |
Desanitizes a string that was previously sanitized for use in string-based serialization systems.
- Parameters
-
- Returns
- Original source string.
◆ ToFloat()
static float PixelCrushers.SafeConvert.ToFloat |
( |
string |
s | ) |
|
|
inlinestatic |
Converts a string to a float.
- Parameters
-
- Returns
- float value, or 0 on conversion failure.
◆ ToInt()
static int PixelCrushers.SafeConvert.ToInt |
( |
string |
s | ) |
|
|
inlinestatic |
Converts a string to an int.
- Parameters
-
- Returns
- int value, or 0 on conversion failure.
◆ ToSerializedElement()
static string PixelCrushers.SafeConvert.ToSerializedElement |
( |
string |
s | ) |
|
|
inlinestatic |
Sanitizes a string so it can be serialized to string-based serialization systems.
- Parameters
-
- Returns
- Sanitized version.
The documentation for this class was generated from the following file:
- C:/Dev/LoveHate/Dev/Source/Assets/Plugins/Pixel Crushers/Common/Scripts/Misc/SafeConvert.cs