Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Collections.​Specialized.​StringCollection
Assembly: System.Collections.Specialized
Inheritance: object → StringCollection
Implemented Interfaces
- IList (Inherits: ICollectionIEnumerable)
Represents a collection of strings.
Properties
public
int
Count
Gets the number of strings contained in the <see cref="T:System.Collections.Specialized.StringCollection" /> .
public
bool
IsReadOnly
Gets a value indicating whether the <see cref="T:System.Collections.Specialized.StringCollection" /> is read-only.
public
bool
IsSynchronized
Gets a value indicating whether access to the <see cref="T:System.Collections.Specialized.StringCollection" /> is synchronized (thread safe).
public
string
Item
public
object
SyncRoot
Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.StringCollection" /> .
Methods
public
int
Add​(string value)
Adds a string to the end of the <see cref="T:System.Collections.Specialized.StringCollection" /> .
Returns The zero-based index at which the new element is inserted.
value
The string to add to the end of the <see cref="T:System.Collections.Specialized.StringCollection" /> . The value can be <see langword="null" /> .
public
void
AddRange​(string[] value)
Copies the elements of a string array to the end of the <see cref="T:System.Collections.Specialized.StringCollection" /> .
value
An array of strings to add to the end of the <see cref="T:System.Collections.Specialized.StringCollection" /> . The array itself can not be <see langword="null" /> but it can contain elements that are <see langword="null" /> .
public
void
Clear​()
Removes all the strings from the <see cref="T:System.Collections.Specialized.StringCollection" /> .
public
bool
Contains​(string value)
Determines whether the specified string is in the <see cref="T:System.Collections.Specialized.StringCollection" /> .
Returns <see langword="true" /> if <paramref name="value" /> is found in the <see cref="T:System.Collections.Specialized.StringCollection" /> ; otherwise, <see langword="false" /> .
value
The string to locate in the <see cref="T:System.Collections.Specialized.StringCollection" /> . The value can be <see langword="null" /> .
public
void
CopyTo​(string[] array,
int index)
Copies the entire <see cref="T:System.Collections.Specialized.StringCollection" /> values to a one-dimensional array of strings, starting at the specified index of the target array.
array
The one-dimensional array of strings that is the destination of the elements copied from <see cref="T:System.Collections.Specialized.StringCollection" /> . The <see cref="T:System.Array" /> must have zero-based indexing.
index
The zero-based index in <paramref name="array" /> at which copying begins.
public
StringEnumerator
GetEnumerator​()
Returns a <see cref="T:System.Collections.Specialized.StringEnumerator" /> that iterates through the <see cref="T:System.Collections.Specialized.StringCollection" /> .
Returns A <see cref="T:System.Collections.Specialized.StringEnumerator" /> for the <see cref="T:System.Collections.Specialized.StringCollection" /> .
public
int
IndexOf​(string value)
Searches for the specified string and returns the zero-based index of the first occurrence within the <see cref="T:System.Collections.Specialized.StringCollection" /> .
Returns The zero-based index of the first occurrence of <paramref name="value" /> in the <see cref="T:System.Collections.Specialized.StringCollection" /> , if found; otherwise, -1.
value
The string to locate. The value can be <see langword="null" /> .
public
void
Insert​(int index,
string value)
Inserts a string into the <see cref="T:System.Collections.Specialized.StringCollection" /> at the specified index.
index
The zero-based index at which <paramref name="value" /> is inserted.
value
The string to insert. The value can be <see langword="null" /> .
public
void
Remove​(string value)
Removes the first occurrence of a specific string from the <see cref="T:System.Collections.Specialized.StringCollection" /> .
value
The string to remove from the <see cref="T:System.Collections.Specialized.StringCollection" /> . The value can be <see langword="null" /> .
public
void
RemoveAt​(int index)
Removes the string at the specified index of the <see cref="T:System.Collections.Specialized.StringCollection" /> .
index
The zero-based index of the string to remove.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object