Next: , Previous: String Searching, Up: Strings


21.4.9 Alphabetic Case Mapping

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

— Scheme Procedure: string-upcase str [start [end]]
— C Function: scm_string_upcase (str, start, end) |1 |2 |0

Return a new string made by upcasing every character in str.

— Scheme Procedure: string-upcase! str [start [end]]
— C Function: scm_string_upcase_x (str, start, end) |1 |2 |0

Destructively upcase every character in str.

          (string-upcase! y)
          ⇒ "ARRDEFG"
          y
          ⇒ "ARRDEFG"
— Scheme Procedure: string-downcase str [start [end]]
— C Function: scm_string_downcase (str, start, end) |1 |2 |0

Return a new string made by downcasing every character in str.

— Scheme Procedure: string-downcase! str [start [end]]
— C Function: scm_string_downcase_x (str, start, end) |1 |2 |0

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 new string made by capitalizing every word in str.

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

Destructively capitalize every word in str. This means the first letter of a word is upcased and the other letters downcased. Words are recognized as a sequence of char-alphabetic? characters. str must not be a shared substring.