TX Text Control .NET Server

Remove Method

Method|Introduced in 16.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words, but not the word's text in the document. If text is specified, this text replaces the word's text.

Syntax

Remove(MisspelledWord)

Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words, but not the word's text in the document.

public bool Remove(MisspelledWord misspelledWord);
ParameterDescription
misspelledWord

Specifies the misspelled word to remove.

Remove(MisspelledWord, string)

Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words and replaces the word's text with the specified text.

public bool Remove(MisspelledWord misspelledWord, string correctedText);
ParameterDescription
misspelledWord

Specifies the misspelled word to remove.

correctedText

Specifies the corrected text. The current text of the word is replaced with this text.

Return Value

The return value is true, if the misspelled word could be removed. Otherwise, it is false.

Examples

The following example works with misspelled words in the current document by using MisspelledWordCollection.Remove.

MisspelledWordCollection misspelledWordCollection = textControl.MisspelledWords;

if (misspelledWordCollection.Count > 0)
{
    MisspelledWord misspelledWord = misspelledWordCollection[1];
    if (misspelledWordCollection.Remove(misspelledWord))
    {
        Console.WriteLine("The item was removed.");
    }
}