String functions

[Example 44] <C>

Function string() transforms its argument into string. This function is not usualy directly used in stylesheets as it is in most cases called by default. This stylesheet shows examples of number to string conversions. Notice results of zero divisions.

[Example 45] <C>

The concat function returns the concatenation of its arguments.

[Example 46] <C>

The starts-with function returns true if the first argument string starts with the second argument string, and otherwise returns false. The contains function returns true if the first argument string contains the second argument string, and otherwise returns false.

[Example 47] <C>

The substring-before function returns the substring of the first argument string that precedes and the substring-after function that follows the first occurrence of the second argument string in the first argument string. The substring function returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument. If the third argument is not specified, it returns the substring starting at the position specified in the second argument and continuing to the end of the string.Counting starts with 1. (This stylesheet). This stylesheet demonstrates a situation where some arguments are out of range or they are not integrals. The returned substring contains those characters for which the position of the character is greater than or equal to the second argument and, if the third argument is specified, less than the sum of the second and third arguments.

[Example 48] <C>

The string-length function returns the number of characters in the string. The normalize-space function returns the argument string with white space normalized by stripping leading and trailing whitespace and replacing sequences of whitespace characters by a single space.

[Example 49 ] <C>

The string-length function returns the number of characters in the string. The normalize-space function returns the argument string with white space normalized by stripping leading and trailing whitespace and replacing sequences of whitespace characters by a single space.