Table of Contents

Class StringOrStringList

Namespace
SunamoString._public
Assembly
SunamoString.dll

Wraps either a single string or a list of strings, with lazy conversion between the two.

public class StringOrStringList
Inheritance
StringOrStringList
Inherited Members
Extension Methods

Constructors

StringOrStringList(List<string>)

Initializes a new instance wrapping a list of strings.

public StringOrStringList(List<string> list)

Parameters

list List<string>

The list of strings.

StringOrStringList(string)

Initializes a new instance wrapping a single string.

public StringOrStringList(string text)

Parameters

text string

The string value.

Properties

List

The stored list of strings, or null if initialized with a string.

public List<string> List { get; }

Property Value

List<string>

String

The stored string value, or null if initialized with a list.

public string String { get; }

Property Value

string

Methods

GetList()

Gets the value as a list of strings. If initialized with a string, splits it by non-letter-or-digit characters.

public List<string> GetList()

Returns

List<string>

GetString()

Gets the value as a single string. If initialized with a list, joins the list elements with spaces.

public string GetString()

Returns

string