Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

string-not-greaterp

string-not-greaterp

type: predicate function (subr) 
location: built-in
source file: xlstr.c
Common LISP compatible: yes
supported on: all machines

SYNTAX

(string-not-greaterp <string1> <string2> [ <key> <offset> ] ... )
        <string1>       -       a string expression
        <string2>       -       a string expression
        <key>           -       a keyword (one of :START1 :START2 :END1 :END2 )
        <offset>        -       an optional integer expression (for a keyword)

DESCRIPTION

The STRING-NOT-GREATERP function takes two string arguments. A non-NIL value is returned if <string1> is less than or equal to <string2> in an ASCII ordering, otherwise NIL is returned. The non-NIL value returned is the integer index of the first character of <string1> which is CHAR-NOT-GREATERP the corresponding character of <string2>. This test is not case sensitive - the character #\a is considered to be the same as #\A.

The keyword arguments allow for accessing substrings within <string1> and <string2>. The keyword arguments each require the keyword (:START1 :END1 :START2 :END2) and a single integer expression as a pair with the keyword first and the integer second. The pairs may be in any order. The start keywords specify the starting offset of the substring. A value of 0 starts the string at the beginning (no offset). The end keywords specify the ending offset of the substring. A value of 3 ends the string after the 3rd character (an offset of 3 characters).

EXAMPLES

(string-not-greaterp "a" "b")           ; returns 0
(string-not-greaterp "b" "a")           ; returns NIL
(string-not-greaterp "a" "a")           ; returns 1
(string-not-greaterp "a" "A")           ; returns 1
(string-not-greaterp "A" "a")           ; returns 1
(string-not-greaterp "abc" "abc ")      ; returns 3
(string-not-greaterp "12345" "1234qr")  ; returns 4
                                        ;
(string-not-greaterp "J Smith" "K Smith"; strip off the first chars 
          :start1 1 :start2 1)          ; returns 7


Go to the first, previous, next, last section, table of contents.