Table of contents
TOC
Collapse the table of content
Expand the table of content

SafeConvertExtensions Class

SharePoint Dev Documents|Last Updated: 6/22/2017
|
1 Contributor

Safely convert strings to specified types.

Namespace:System
Assembly: OfficeDevPnP.Core.dll

Inheritance Hierarchy

System.Object

Syntax

public static class SafeConvertExtensions

Extension Methods

NameDescription
ToBoolean(String, Boolean)Converts the input string to a boolean and if null, it returns the default value.
ToBoolean(String)Converts the input string to a boolean and if null, it returns the default value.
ToDouble(String, Double)Converts the input string to a double and if null, it returns the default value.
ToDouble(String)Converts the input string to a double and if null, it returns the default value.
ToEnum<T>(Int32)Converts integer input to Enum
ToEnum<T>(Byte)Converts byte input to Enum
ToEnum<T>(String)Converts input string to Enum
ToGuid(String)Converts the input string to a Guid and if null, it returns the default value.
ToGuid(String, Guid)Converts the input string to a Guid and if null, it returns the default value.
ToInt32(String, Int32)Converts the input string to a Int32 and if null, it returns the default value.
ToInt32(String)Converts the input string to a Int64 and if null, it returns the default value.
ToInt64(String, Int32)Converts the input string to a Int32 and if null, it returns the default value.
ToInt64(String)Converts the input string to a Int32 and if null, it returns the default value.

See also

© 2018 Microsoft