Star Sapphire Common LISP Home

Download Star Saphire
Index

18. STRINGS

This chapter contains the following sections:

18.0 Introduction to Strings

18.1 String Access

18.2 String Comparison

18.3 String Construction and Manipulation

 

18.0 Introduction to Strings

A string is a specialized vector (one-dimensional array) whose elements are characters.

Also, there is a slight non-parallelism in the names of string functions. Where the suffixes equalp and eql would be more appropriate, for historical compatibility the suffixes equal and = are used instead to indicate case-insensitive and case-sensitive character comparison, respectively.

Any LISP object may be tested for being a string by the predicate stringp.

Note that strings, like all vectors, may have fill pointers (though such strings are not necessarily simple). String operations generally operate only on the active portion of the string (below the fill pointer). See fill-pointer and related functions.

 

18.1 String Access

The following functions access a single character element of a string.

char

schar

 

18.2 String Comparison

The following functions compare two strings.

string=

string<

string>

string<=

string>=

string/=

string-equal

string-lessp

string-greaterp

string-not-greaterp

string-not-lessp

string-not-equal

18.3 String Construction and Manipulation

Most of the interesting operations on strings may be performed with the generic sequence functions described in Chapter 14. The following functions perform additional operations that are specific to stings.

make-string

string-trim

string-left-trim

string-right-trim

string-upcase

string-downcase

string-capitalize

nstring-upcase

nstring-downcase

nstring-capitalize

string