Interface IParser
public interface IParser
Methods
Parse(string, Type)
Converts the specified input to an object of targetType.
object Parse(string input, Type targetType)
Parameters
Returns
- object
An object of
targetTypeequivalent toinput.
Parse<T>(string)
Converts the specified input to an object of T.
T Parse<T>(string input)
Parameters
inputstringThe string to convert.
Returns
- T
An object of
Tequivalent toinput.
Type Parameters
TThe type of the object to return.
TryParse(string, Type, out object)
Converts the specified input to an object of targetType. A return value indicates whether the conversion succeeded.
bool TryParse(string input, Type targetType, out object result)
Parameters
inputstringThe string to convert.
targetTypeTypeThe type of the object to return.
resultobjectWhen this method returns, contains the object of
targetTypeequivalent toinput, if the conversion succeeded, ordefaultif the conversion failed.
Returns
- bool
trueifinputwas converted successfully; otherwise,false.
TryParse<T>(string, out T)
Converts the specified input to an object of T. A return value indicates whether the conversion succeeded.
bool TryParse<T>(string input, out T result)
Parameters
inputstringThe string to convert.
resultTWhen this method returns, contains the object of
Tequivalent toinput, if the conversion succeeded, ordefaultif the conversion failed.
Returns
- bool
trueifinputwas converted successfully; otherwise,false.
Type Parameters
TThe type of the object to return.