<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.substringBefore.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.substringBefore</api:function-name><api:suggest>fn.substringbefore</api:suggest><api:suggest>fn</api:suggest><api:suggest>substringbefore</api:suggest><api:function-link mode="xquery" fullname="fn:substring-before">/apidoc/8.0/fn:substring-before.xml</api:function-link><api:function mode="javascript" name="substringBefore" type="builtin" lib="fn" category="StringBuiltins" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.substringBefore"><api:summary>
  Returns the substring created by taking all of the input characters
  that occur before the specified $before characters.
</api:summary><api:params><api:param name="input" type="xs:string?"><api:param-description>
  The string from which to create the substring.
  </api:param-description><api:param-name>input</api:param-name><api:param-type>String?</api:param-type></api:param><api:param name="before" type="xs:string?"><api:param-description>
  The string before which the substring is created.
  </api:param-description><api:param-name>before</api:param-name><api:param-type>String?</api:param-type></api:param><api:param name="collation" type="xs:string" optional="true"><api:param-description>
  The optional name of a valid collation URI.  For information on the
  collation URI syntax, see the <em xmlns="http://www.w3.org/1999/xhtml">Search Developer's Guide</em>.
  </api:param-description><api:param-name>collation</api:param-name><api:param-type>String</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.substringBefore("abcdef", "def");

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