6.6.5.9 Alphabetic Case Mapping

These are procedures for mapping strings to their upper- or lower-case equivalents, respectively, or for capitalizing strings.

They use the basic case mapping rules for Unicode characters. No special language or context rules are considered. The resulting strings are guaranteed to be the same length as the input strings.

See the (ice-9 i18n) module, for locale-dependent case conversions.

Scheme Procedure: string-upcase str [start [end]]
C Function: scm_substring_upcase (str, start, end)
C Function: scm_string_upcase (str)

Upcase every character in str.

Scheme Procedure: string-upcase! str [start [end]]
C Function: scm_substring_upcase_x (str, start, end)
C Function: scm_string_upcase_x (str)

Destructively upcase every character in str.

(string-upcase! y)
⇒ "ARRDEFG"
y
⇒ "ARRDEFG"
Scheme Procedure: string-downcase str [start [end]]
C Function: scm_substring_downcase (str, start, end)
C Function: scm_string_downcase (str)

Downcase every character in str.

Scheme Procedure: string-downcase! str [start [end]]
C Function: scm_substring_downcase_x (str, start, end)
C Function: scm_string_downcase_x (str)

Destructively downcase every character in str.

y
⇒ "ARRDEFG"
(string-downcase! y)
⇒ "arrdefg"
y
⇒ "arrdefg"
Scheme Procedure: string-capitalize str
C Function: scm_string_capitalize (str)

Return a freshly allocated string with the characters in str, where the first character of every word is capitalized.

Scheme Procedure: string-capitalize! str
C Function: scm_string_capitalize_x (str)

Upcase the first character of every word in str destructively and return str.

y                      ⇒ "hello world"
(string-capitalize! y) ⇒ "Hello World"
y                      ⇒ "Hello World"
Scheme Procedure: string-titlecase str [start [end]]
C Function: scm_string_titlecase (str, start, end)

Titlecase every first character in a word in str.

Scheme Procedure: string-titlecase! str [start [end]]
C Function: scm_string_titlecase_x (str, start, end)

Destructively titlecase every first character in a word in str.