.. highlightlang:: us .. index:: strextract .. _strextract: strextract ========== .. us.tag strextract ENGLISH STR Changed420 Changed5111 :ref:`strextract` returns a substring of its argument string. .. function:: ssExtract = strextract(ssString, nPosition) ssExtract = strextract(ssString, nPosition, nLength) .. us.return **Return Value** *ssExtract* is a substring of the scalar string *ssString* of the length *nLength*. In case of an error, the function returns an empty string (""). .. us.params **Parameters** .. uparam:: ssString *ssString* is a scalar string. .. uparam:: nPosition *nPosition* is the start position of the substring character counting starts with 1. .. uparam:: nLength *nLength* defines the length of the substring. If the function is called with two parameters, the function returns substring from the start position to the end of the string. If the number of characters starting at *nPosition* is smaller than *nLength*, the function returns the remaining characters. .. us.example **Example** :: * strextract("This is a String", 6, 4) * is a * strextract("This is a String", 6) * is a String .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.11.1 - If the number of characters starting at *nPosition* is smaller than *nLength*, the function returns the remaining characters. Before that change the function returned an empty string. * - 4.2.0 - The function can be used for 8-bit clean strings (may contain 0-characters). .. seealso:: :ref:`overview-strings`, :ref:`strtok`, :ref:`strfind`, :ref:`strfindreplace`, :ref:`strtrim` :sub:`id-1792161`