Microsoft XML 2.5 SDK


 

substringData Method

[This is preliminary documentation and subject to change.]

Retrieves a substring of the full string from the specified range.

Syntax

strValue = oXMLDOMCharacterData.substringData(offset, count)

Parameters

offset

Long integer value indicating the offset, in characters, from the beginning of the string. An offset of zero indicates copying from the start of the data.

count

Long integer value indicating the number of characters to retrieve from the specified offset.

Returns

String. Returns the substring.

Remarks

If the offset and count parameters indicate a range beyond the end of the string, the returned substring continues only until the end of the string data.

Example

The following example creates an XMLDOMComment object (comment), then uses the substringData method to retrieve the first five characters of the object:

Dim xmlDoc
Dim comment
Dim MyStr
Set xmlDoc = CreateObject("microsoft.xmldom")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")
Set comment = xmlDoc.createComment("Hello World!")
MyStr = comment.subStringData(0,5)
msgbox strValue

Applies To

XMLDOMCDATASection, XMLDOMCharacterData, XMLDOMComment, XMLDOMText