Table of Contents

Interface IParser

Namespace
Cuemon.Text
Assembly
Cuemon.Core.dll

Defines methods that converts a String to an Object of a particular type.

public interface IParser

Methods

Parse(String, Type)

Converts the specified input to an object of targetType.

object Parse(string input, Type targetType)

Parameters

input String

The string to convert.

targetType Type

The type of the object to return.

Returns

Object

An object of targetType equivalent to input.

Parse<T>(String)

Converts the specified input to an object of T.

T Parse<T>(string input)

Parameters

input String

The string to convert.

Returns

T

An object of T equivalent to input.

Type Parameters

T

The 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

input String

The string to convert.

targetType Type

The type of the object to return.

result Object

When this method returns, contains the object of targetType equivalent to input, if the conversion succeeded, or default if the conversion failed.

Returns

Boolean

true if input was 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

input String

The string to convert.

result T

When this method returns, contains the object of T equivalent to input, if the conversion succeeded, or default if the conversion failed.

Returns

Boolean

true if input was converted successfully; otherwise, false.

Type Parameters

T

The type of the object to return.