expressions: Implement the STRUNC function.
[pspp] / doc / expressions.texi
index e468b8750ac457361b878a7788ac24e6d0e8a544..5898d53d77cd0c604666de83b5d171e6c5c8be2a 100644 (file)
@@ -264,7 +264,8 @@ The sections below describe each function in detail.
 * Set Membership::              ANY RANGE
 * Statistical Functions::       CFVAR MAX MEAN MEDIAN MIN SD SUM VARIANCE
 * String Functions::            CONCAT INDEX LENGTH LOWER LPAD LTRIM NUMBER 
-                                REPLACE RINDEX RPAD RTRIM STRING SUBSTR UPCASE
+                                REPLACE RINDEX RPAD RTRIM STRING STRUNC SUBSTR
+                                UPCASE
 * Time and Date::               CTIME.xxx DATE.xxx TIME.xxx XDATE.xxx
                                 DATEDIFF DATESUM
 * Miscellaneous Functions::     LAG YRMODA VALUELABEL
@@ -691,6 +692,15 @@ format specifier @var{format}.  For example, @code{STRING(123.56, F5.1)}
 has the value @code{"123.6"}.
 @end deftypefn
 
+@cindex strings, trimming
+@cindex strings, truncating
+@cindex white space, trimming
+@deftypefn {Function} {} STRUNC (@var{string}, @var{n})
+Returns @var{string}, first trimming it to at most @var{n} bytes, then
+removing trailing spaces.  Returns an empty string if @var{n} is
+missing or negative.
+@end deftypefn
+
 @cindex substrings
 @cindex strings, taking substrings of
 @deftypefn {Function} {} SUBSTR (@var{string}, @var{start})