Class StringList

Namespace
NOpenNLP.Tools.Util
Assembly
NOpenNLP.Tools.dll

The StringList is an immutable list of strings.

public class StringList : IEnumerable<string>, IEnumerable
Inheritance
StringList
Implements
Inherited Members

Constructors

StringList(string)

Initializes the current instance.

Note:
Token String will be replaced by identical internal String object.

public StringList(string singleToken)

Parameters

singleToken string

one single token

StringList(params string[])

Initializes the current instance.

Note:
Token Strings will be replaced by identical internal String object.

public StringList(params string[] tokens)

Parameters

tokens string[]

the string parts of the new StringList, an empty tokens array or null is not permitted.

Properties

Count

Retrieves the number of tokens inside this list.

public virtual int Count { get; }

Property Value

int

number of tokens

Methods

CompareToIgnoreCase(StringList)

Compares to tokens list and ignores the case of the tokens.

Note: This can cause problems with some locals.

public virtual bool CompareToIgnoreCase(StringList tokens)

Parameters

tokens StringList

Returns

bool

true if identically with ignore the case otherwise false

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetEnumerator()

Retrieves an IEnumerator<T> over all tokens.

public virtual IEnumerator<string> GetEnumerator()

Returns

IEnumerator<string>

iterator over tokens

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetToken(int)

Retrieves a token from the given index.

public virtual string GetToken(int index)

Parameters

index int

Returns

string

token at the given index

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.