Loading TOC...

MarkLogic 10 Product Documentation
CharacterData.substring

CharacterData.substring(
   offset as Number,
   count as Number
) as Number

Summary

A substring of the character data, starting at a given offset and continuing for a given length.

Parameters
offset The starting position.
count The length of the substring to return.

Usage Notes

The offset and count should be non-negative integers. An error will be raised if they are not.

It is an error for the offset plus the count is more than the size of the data.

Example

cts.doc("example.xml").root.firstChild.substring(2,5)

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.