<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.substring.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.substring</api:function-name><api:suggest>fn.substring</api:suggest><api:suggest>fn</api:suggest><api:suggest>substring</api:suggest><api:function-link mode="xquery" fullname="fn:substring">/apidoc/8.0/fn:substring.xml</api:function-link><api:function mode="javascript" name="substring" type="builtin" lib="fn" category="StringBuiltins" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.substring"><api:summary>
Returns a substring starting from the $startingLoc and continuing
for $length characters.
</api:summary><api:params><api:param name="sourceString" type="xs:string?"><api:param-description>
  The string from which to create a substring.
  </api:param-description><api:param-name>sourceString</api:param-name><api:param-type>String?</api:param-type></api:param><api:param name="startingLoc" type="xs:double"><api:param-description>
  The number of characters from the start of the $sourceString.
  </api:param-description><api:param-name>startingLoc</api:param-name><api:param-type>Number</api:param-type></api:param><api:param name="length" type="xs:double" optional="true"><api:param-description>
  The number of characters beyond the $startingLoc.
  </api:param-description><api:param-name>length</api:param-name><api:param-type>Number</api:param-type></api:param></api:params><api:return>String?</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
fn.substring("123456", 2, 2);

=&gt; "23"
</pre>
</api:example></api:function></api:function-page>