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
textstringThe string to parse.
contextITypeDescriptorContextITypeDescriptorContext value which is used when text is converted.
cultureCultureInfoCultureInfo value which is used when text is converted.
useInvariantCultureboolWhether to use TypeConverter with invariant string to value conversion.
Returns
- T
Object parsed from the string or Null.
Type Parameters
TType 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
textstringThe string to parse.
typeConverterTypeConvertercontextITypeDescriptorContextITypeDescriptorContext value which is used when text is converted.
cultureCultureInfoCultureInfo value which is used when text is converted.
useInvariantCultureboolWhether to use TypeConverter with invariant string to value conversion.
Returns
- object
Object parsed from the string or Null.