Home Cooker Classes Others Rice CookerGX
Classes  >  element  >  ReplaceAdjacentText(string,string)
element class : ReplaceAdjacentText(string,string) method


Replaces a text at the specified position.


elementInstance.ReplaceAdjacentText(string where, string text)


stringwhereA string that indicates the position which to replace.
stringtextA replace text.

Return value

stringA string that was replaced.

Sample code

//anyElement is any instance of element type.

string where = "afterBegin"

string text = "any text";

anyElement.ReplaceAdjacentText(where, text);


It's a wrapper of the MSHTML.IHTMLElement2.replaceAdjacentText(String,String).

The following values can specify as the first argument.

beforeBegin: The previous sibling of the invoker element.

afterBegin: The first child of the invoker element.

beforeEnd: The last child of the invoker element.

afterEnd: The next sibling of the invoker element.

If there is no text at specified position, argument text is inserted at specified position and returns empty string.

The text will automatically be HTML escaped.

Links for reference

Copyright © Rice All rights reserved.