Table of Contents

Class StringOr<T>

This object can be either a string, T, or an array of T.

public class StringOr<T>

Type Parameters

T

The type of the object that can be stored in the StringOr.

Inheritance
StringOr<T>
Inherited Members
Extension Methods

Constructors

StringOr(bool)

public StringOr(bool isArray = false)

Parameters

isArray bool

StringOr(IEnumerable)

public StringOr(IEnumerable arrayValue)

Parameters

arrayValue IEnumerable

StringOr(string)

public StringOr(string stringValue)

Parameters

stringValue string

StringOr(T)

public StringOr(T objectValue)

Parameters

objectValue T

Fields

Value

public object Value

Field Value

object

Properties

HasValue

public bool HasValue { get; }

Property Value

bool

IsArray

public bool IsArray { get; }

Property Value

bool

IsObject

public bool IsObject { get; }

Property Value

bool

IsString

public bool IsString { get; }

Property Value

bool

Length

Returns the length of the array if the value is an array, returns the length of the string if the value is a string, otherwise returns 0.

public int Length { get; }

Property Value

int

Methods

Add(T)

public void Add(T value)

Parameters

value T

ToArray()

public T[] ToArray()

Returns

T[]

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

implicit operator StringOr<T>(string)

public static implicit operator StringOr<T>(string stringValue)

Parameters

stringValue string

Returns

StringOr<T>

implicit operator StringOr<T>(T)

public static implicit operator StringOr<T>(T objectValue)

Parameters

objectValue T

Returns

StringOr<T>

implicit operator StringOr<T>(T[])

public static implicit operator StringOr<T>(T[] arrayValue)

Parameters

arrayValue T[]

Returns

StringOr<T>