Table of Contents

Class StringList

Namespace
Microsoft.Exchange.WebServices.Data
Assembly
Microsoft.Exchange.WebServices.dll

Represents a list of strings.

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

Constructors

StringList()

Initializes a new instance of the StringList class.

public StringList()

StringList(IEnumerable<string>)

Initializes a new instance of the StringList class.

public StringList(IEnumerable<string> strings)

Parameters

strings IEnumerable<string>

The strings.

Properties

Count

Gets the number of strings in the list.

public int Count { get; }

Property Value

int

this[int]

Gets or sets the string at the specified index.

public string this[int index] { get; set; }

Parameters

index int

The index of the string to get or set.

Property Value

string

The string at the specified index.

Methods

Add(string)

Adds a string to the list.

public void Add(string s)

Parameters

s string

The string to add.

AddRange(IEnumerable<string>)

Adds multiple strings to the list.

public void AddRange(IEnumerable<string> strings)

Parameters

strings IEnumerable<string>

The strings to add.

Clear()

Clears the list.

public void Clear()

Contains(string)

Determines whether the list contains a specific string.

public bool Contains(string s)

Parameters

s string

The string to check the presence of.

Returns

bool

True if s is present in the list, false otherwise.

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.

Exceptions

NullReferenceException

The obj parameter is null.

GetEnumerator()

Gets an enumerator that iterates through the elements of the collection.

public IEnumerator<string> GetEnumerator()

Returns

IEnumerator<string>

An IEnumerator for the collection.

GetHashCode()

Serves as a hash function for a particular type.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Remove(string)

Removes a string from the list.

public bool Remove(string s)

Parameters

s string

The string to remove.

Returns

bool

True is s was removed, false otherwise.

RemoveAt(int)

Removes the string at the specified position from the list.

public void RemoveAt(int index)

Parameters

index int

The index of the string to remove.

ToString()

Generates a string representation of all the items in the list.

public override string ToString()

Returns

string

A comma-separated list of the strings present in the list.