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
StringOrStringList(string)
Initializes a new instance wrapping a single string.
public StringOrStringList(string text)
Parameters
textstringThe string value.
Properties
List
The stored list of strings, or null if initialized with a string.
public List<string> List { get; }
Property Value
String
The stored string value, or null if initialized with a list.
public string String { get; }
Property Value
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
GetString()
Gets the value as a single string. If initialized with a list, joins the list elements with spaces.
public string GetString()