Converts the provided value to the specified type. This method never throws an exception.
It will return default(T) if the value cannot be converted to T.
- Namespace
- Statiq.Common
- Containing Type
- TypeHelper
Syntax
public static T Convert<T>(object value)
Type Parameters
Name |
Description |
T |
The desired return type. |
Parameters
Name |
Type |
Description |
value |
object |
The value to convert. |
Return Value
Type |
Description |
T |
The value converted to type T or default(T) if the value cannot be converted to type T. |