Method ParseWithTypeConverter
ParseWithTypeConverter<T>(string?, ITypeDescriptorContext?, CultureInfo?, bool)
Parses the string representation of an object using TypeConverter
registered for the T
type.
public static T? ParseWithTypeConverter<T>(string? text, ITypeDescriptorContext? context = null, CultureInfo? culture = null, bool useInvariantCulture = true)
Parameters
text
stringThe string to parse.
context
ITypeDescriptorContextITypeDescriptorContext value which is used when text is converted.
culture
CultureInfoCultureInfo value which is used when text is converted.
useInvariantCulture
boolWhether to use TypeConverter with invariant string to value conversion.
Returns
- T
Object parsed from the string or Null.
Type Parameters
T
Type of the object to parse from the string.
ParseWithTypeConverter(string?, TypeConverter?, ITypeDescriptorContext?, CultureInfo?, bool)
Parses the string representation of an object using the specified type converter.
public static object? ParseWithTypeConverter(string? text, TypeConverter? typeConverter = null, ITypeDescriptorContext? context = null, CultureInfo? culture = null, bool useInvariantCulture = true)
Parameters
text
stringThe string to parse.
typeConverter
TypeConvertercontext
ITypeDescriptorContextITypeDescriptorContext value which is used when text is converted.
culture
CultureInfoCultureInfo value which is used when text is converted.
useInvariantCulture
boolWhether to use TypeConverter with invariant string to value conversion.
Returns
- object
Object parsed from the string or Null.