StringExtensionParse(String, Type, NullableNumberStyles, IFormatProvider, NullableDateTimeStyles) Method

Converts value to the target type.

Definition

Namespace: FileHold.LibraryManager.Extensions
Assembly: FileHold.LibraryManager (in FileHold.LibraryManager.dll) Version: 17.2.0.0
C#
public static Object Parse(
	this string value,
	Type targetType,
	NumberStyles? numberStyles = null,
	IFormatProvider formatProvider = null,
	DateTimeStyles? dateTimeStyles = null
)

Parameters

value  String
The value to be checked for conversion.
targetType  Type
The target type.
numberStyles  NullableNumberStyles  (Optional)
The number stypes.
formatProvider  IFormatProvider  (Optional)
The format provider.
dateTimeStyles  NullableDateTimeStyles  (Optional)
The date time styles.

Return Value

Object
True if the value can be converted to the target type; otherwise, false.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also