Все буквы в заглавный регистр

(string-upcase "How about that!")
"HOW ABOUT THAT!"

Определить длину строки

(length "Four score and seven years ago")
30

Получить часть строки

(subseq "Four score and seven years ago" 9)
(subseq "Four score and seven years ago" 9 23)
"e and seven years ago"
"e and seven ye"

Заменить подстроку в строке

(defparameter *my-string* (string "Harpo Marx"))
; *MY-STRING*
(subseq *my-string* 0 5)
; "Harpo"
(setf (subseq *my-string* 0 5) "Chico")
; "Chico"
*my-string*
; "Chico Marx"

Получить/заменить определённый символ в строке

(defparameter *my-string* (string "Groucho Marx"))
; *MY-STRING*
(char *my-string* 11)
; #\x
(char *my-string* 7)
; #\Space
(char *my-string* 6)
; #\o
(setf (char *my-string* 6) #\y)
; #\y
*my-string*
; "Grouchy Marx"

Преобразование символа в код (и наоборот)

(stream-external-format *standard-output*)
; :UTF-8

(code-char 200)
; #\LATIN_CAPITAL_LETTER_E_WITH_GRAVE

(char-code #\LATIN_CAPITAL_LETTER_E_WITH_GRAVE)
; 200

(code-char 1488)
; #\HEBREW_LETTER_ALEF

(char-code #\HEBREW_LETTER_ALEF)
; 1488

Удаление и замена символов в строке

(remove #\o "Harpo Marx")
; "Harp Marx"
(remove #\a "Harpo Marx")
; "Hrpo Mrx"
(remove #\a "Harpo Marx" :start 2)
; "Harpo Mrx"
(remove-if #'upper-case-p "Harpo Marx")
; "arpo arx"
(substitute #\u #\o "Groucho Marx")
; "Gruuchu Marx"
(substitute-if #\_ #'upper-case-p "Groucho Marx")
; "_roucho _arx"
(defparameter *my-string* (string "Zeppo Marx"))
; *MY-STRING*
(replace *my-string* "Harpo" :end1 5)
; "Harpo Marx"
*my-string*
; "Harpo Marx"

Замена всех вхождений подстроки в строке

(defun replace-all (string part replacement &key (test #'char=))
"Returns a new string in which all the occurences of the part 
is replaced with replacement."
    (with-output-to-string (out)
      (loop with part-length = (length part)
            for old-pos = 0 then (+ pos part-length)
            for pos = (search part string
                              :start2 old-pos
                              :test test)
            do (write-string string out
                             :start old-pos
                             :end (or pos (length string)))
            when pos do (write-string replacement out)
            while pos))) 

(replace-all "Groucho Marx Groucho" "Groucho" "ReplacementForGroucho")
; "ReplacementForGroucho Marx ReplacementForGroucho"

Объединение строк

(concatenate 'string "Karl" " " "Marx")
; "Karl Marx"
(concatenate 'list "Karl" " " "Marx")
; (#\K #\a #\r #\l #\Space #\M #\a #\r #\x)

Собрать строку из списка символов

(defparameter *my-string* (make-array 0
                                      :element-type 'character
                                      :fill-pointer 0
                                      :adjustable t))
; *MY-STRING*

*my-string*
; ""

(dolist (char '(#\Z #\a #\p #\p #\a))
    (vector-push-extend char *my-string*))
; NIL

*my-string*
; "Zappa"

Собираем строку из различных объектов

(with-output-to-string (stream)
    (dolist (char '(#\Z #\a #\p #\p #\a #\, #\Space))
      (princ char stream))
    (format stream "~S - ~S" 1940 1993))
; "Zappa, 1940 - 1993"

Посимвольно обходим строку

(defparameter *my-string* (string "Groucho Marx"))
; *MY-STRING*
(map 'string #'(lambda (c) (print c)) *my-string*)
; #\G 
; #\r 
; #\o 
; #\u 
; #\c 
; #\h 
; #\o 
; #\Space 
; #\M 
; #\a 
; #\r 
; #\x 
; "Groucho Marx"

Другой вариант обойти посимвольно строку

(loop for char across "Zeppo"
        collect char)
; (#\Z #\e #\p #\p #\o)

Перевернуть строку задом наперёд

(defparameter *my-string* (string "DSL"))
; *MY-STRING*
(reverse *my-string*)
; "LSD"

Строку в нижний регистр

(string-downcase "COOL")
; "cool"
(string-downcase "Cool")
; "cool"

Каждое слово в строке сделать с заглавной буквы

(string-capitalize "cool example")
; "Cool Example"

Обрезать пробелы (и другие символы) в начале/конце строки

(string-trim " " " trim me ")
; "trim me"
(string-trim " et" " trim me ")
; "rim m"
(string-left-trim " et" " trim me ")
; "rim me "
(string-right-trim " et" " trim me ")
; " trim m"
(string-right-trim '(#\Space #\e #\t) " trim me ")
; " trim m"
(string-right-trim '(#\Space #\e #\t #\m) " trim me ")
; " tri"

Преобразовать символ в строку

(symbol-name 'MY-SYMBOL)
; "MY-SYMBOL"
(symbol-name 'my-symbol)
; "MY-SYMBOL"
(symbol-name '|my-symbol|)
; "my-symbol"
(string 'howdy)
; "HOWDY"

Преобразование между символом и строкой

(coerce "a" 'character)
; #\a
(coerce (subseq "cool" 2 3) 'character)
; #\o
(coerce "cool" 'list)
; (#\c #\o #\o #\l)
(coerce '(#\h #\e #\y) 'string)
; "hey"
(coerce (nth 2 '(#\h #\e #\y)) 'character)
; #\y
(defparameter *my-array* (make-array 5 :initial-element #\x))
; *MY-ARRAY*
*my-array*
; #(#\x #\x #\x #\x #\x)
(coerce *my-array* 'string)
; "xxxxx"
(string 'howdy)
; "HOWDY"
(string #\y)
; "y"
(coerce #\y 'string)
; #\y can't be converted to type STRING.
; [Condition of type SIMPLE-TYPE-ERROR]

Поиск символа в строке

(find #\t "The Hyperspec contains approximately 110,000 hyperlinks." :test #'equal)
; #\t
(find #\t "The Hyperspec contains approximately 110,000 hyperlinks." :test #'equalp)
; #\T
(find #\z "The Hyperspec contains approximately 110,000 hyperlinks." :test #'equalp)
; NIL
(find-if #'digit-char-p "The Hyperspec contains approximately 110,000 hyperlinks.")
; #\1
(find-if #'digit-char-p "The Hyperspec contains approximately 110,000 hyperlinks." :from-end t)
; #\0
(position #\t "The Hyperspec contains approximately 110,000 hyperlinks." :test #'equal)
; 17
(position #\t "The Hyperspec contains approximately 110,000 hyperlinks." :test #'equalp)
; 0
(position-if #'digit-char-p "The Hyperspec contains approximately 110,000 hyperlinks.")
; 37
(position-if #'digit-char-p "The Hyperspec contains approximately 110,000 hyperlinks." :from-end t)
; 43

Посчитать колличество символов в строке

(count #\t "The Hyperspec contains approximately 110,000 hyperlinks." :test #'equal)
; 2
(count #\t "The Hyperspec contains approximately 110,000 hyperlinks." :test #'equalp)
; 3
(count-if #'digit-char-p "The Hyperspec contains approximately 110,000 hyperlinks.")
; 6
(count-if #'digit-char-p "The Hyperspec contains approximately 110,000 hyperlinks." :start 38)
; 5

Поиск подстроки в строке

(search "we" "If we can't be free we can at least be cheap")
; 3
(search "we" "If we can't be free we can at least be cheap" :from-end t)
; 20
(search "we" "If we can't be free we can at least be cheap" :start2 4)
; 20
(search "we" "If we can't be free we can at least be cheap" :end2 5 :from-end t)
; 3
(search "FREE" "If we can't be free we can at least be cheap")
; NIL
(search "FREE" "If we can't be free we can at least be cheap" :test #'char-equal)
; 15

Перевести строку в число. Второе возвращаемое значение - место где остановился разбор

(parse-integer "42")
; 42
; 2
(parse-integer "42" :start 1)
; 2
; 2
(parse-integer "42" :end 1)
; 4
; 1
(parse-integer "42" :radix 8)
; 34
; 2
(parse-integer " 42 ")
; 42
; 3
(parse-integer " 42 is forty-two" :junk-allowed t)
; 42
; 3
(parse-integer " 42 is forty-two")
; Error in function PARSE-INTEGER:
;   There's junk in this string: " 42 is forty-two".

Чтобы получить строку из числа в более сложных случаях - можно воспользоваться read-from-string. Но надо быть осторожным - так как при этом читается и исполняется строка.

(read-from-string "#X23")
; 35
; 4
(read-from-string "4.5")
; 4.5
; 3
(read-from-string "6/8")
; 3/4
; 3
(read-from-string "#C(6/8 1)")
; #C(3/4 1)
; 9
(read-from-string "1.2e2")
; 120.00001
; 5
(read-from-string "symbol")
; SYMBOL
; 6
(defparameter *foo* 42)
; *FOO*
(read-from-string "#.(setq *foo* \"gotcha\")")
; "gotcha"
; 23
*foo*
; "gotcha"

Преобразовать число в строку

(write-to-string 250)
; "250"
(write-to-string 250.02)
; "250.02"
(write-to-string 250 :base 5)
; "2000"
(write-to-string (/ 1 3))
; "1/3"

Сравнение двух строк

(string= "Marx" "Marx")
; T
(string= "Marx" "marx")
; NIL
(string-equal "Marx" "marx")
; T
(string< "Groucho" "Zeppo")
; 0
(string< "groucho" "Zeppo")
; NIL
(string-lessp "groucho" "Zeppo")
; 0
(mismatch "Harpo Marx" "Zeppo Marx" :from-end t :test #'char=)
; 3
-----------