Table of Contents

Interface ITokenList

Namespace
AngleSharp.Dom
Assembly
AngleSharp.dll

This type represents a set of space-separated tokens.

[DomName("DOMTokenList")]
public interface ITokenList : IEnumerable<string>, IEnumerable
Inherited Members
Extension Methods

Properties

this[int]

Gets an item in the list by its index.

[DomName("item")]
[DomAccessor(Accessors.Getter)]
string this[int index] { get; }

Parameters

index int

The index of the item.

Property Value

string

The item at the specified index.

Length

Gets the number of contained tokens.

[DomName("length")]
int Length { get; }

Property Value

int

Methods

Add(params string[])

Adds some tokens to the underlying string.

[DomName("add")]
void Add(params string[] tokens)

Parameters

tokens string[]

A list of tokens to add.

Contains(string)

Returns true if the underlying string contains a token, otherwise false.

[DomName("contains")]
bool Contains(string token)

Parameters

token string

The token to search for.

Returns

bool

The result of the search.

Remove(params string[])

Remove some tokens from the underlying string.

[DomName("remove")]
void Remove(params string[] tokens)

Parameters

tokens string[]

A list of tokens to remove.

Toggle(string, bool)

Removes the specified token from string and returns false. If token doesn't exist it's added and the function returns true.

[DomName("toggle")]
bool Toggle(string token, bool force = false)

Parameters

token string

The token to toggle.

force bool

Returns

bool

True if the token has been added, otherwise false.