Previous section: Operations on Stretchy Vectors

Dylan reference manual -- Operations on Strings

Operations on Strings

Strings support lexicographic ordering through a shared implementation of <:
string1  < string2 =>  boolean	[G.F. Method]
When both arguments are strings, < compares strings lexicographically, using < on corresponding elements. If one string is a strict prefix of the other, the shorter string is considered the "smaller" one.

For variations on string comparison (such as comparisons that ignore case), different comparison operators must be used.

as-lowercase   string =>  new-string	[G.F. Method]
This method is equivalent to map (as-lowercase, string).
? define variable x = "Van Gogh"
x
? as-lowercase (x)
"van gogh"
as-lowercase!   string =>  string	[G.F. Method]
This method is equivalent to map-into ( string , as-lowercase, string).
? define variable x = "Van Gogh"
x
? as-lowercase! (x)
"van gogh"
as-uppercase   string =>  new-string	[G.F. Method]
This method is equivalent to map (as-uppercase, string).
? define variable x = "Van Gogh"
x
? as-uppercase (x)
"VAN GOGH"
as-uppercase!   string =>  string	[G.F. Method]
This method is equivalent to map-into ( string , as-uppercase , string).
? define variable x = "Van Gogh"
x
? as-uppercase (x)
"VAN GOGH"

element unicode-string index #key default  =>  character  	[G. F. Method]
The class <unicode-string> provides a constant time implementation for the element function.
element-setter  character unicode-string index =>  character 	[G. F. Method]
The class <unicode-string> provides a constant time implementation for the element-setter function.
element byte-string index #key default  =>  character     	 [G. F. Method]
The class <byte-string> provides a constant time implementation for the element function.
element-setter  character byte-string index =>  character 	[G. F. Method]
The class <byte-string> provides a constant time implementation for the element-setter function.

Next section: Operations on Tables