Click to return to the XML (Extensible Markup Language) home page    
XMLDOMCharacterData repla...     XMLDOMCharacterData Objec...    
Web Workshop  |  XML (Extensible Markup Language)

substringData Method


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

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
XMLDOMCDATASection, XMLDOMCharacterData, XMLDOMComment, XMLDOMText


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.