CSC151.02 2010S Functional Problem Solving : Reference
Primary: [Front Door] [Schedule] - [Academic Honesty] [Instructions]
Current: [Outline] [EBoard] [Reading] [Lab] - [Assignment] [Quiz]
Groupings: [Assignments] [EBoards] [Examples] [Exams] [Handouts] [Labs] [Outlines] [Projects] [Quizzes] [Readings]
References: [A-Z] [By Topic] - [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [CSC151.01 2010S (Weinman)] [CSC151 2009F (Rebelsky)]
Misc: [SamR] [MediaScript] [GIMP]
(string?
val
)
val
is a string.
(make-string
length
ch
)
length
,
containing only copies of ch
.
(string
ch_0
ch_1
...
ch_n
)
n
+1,
by concatenating all of
ch_0
through ch_n
.
(string-append
str_0
str_1
...
str_n
)
str
through str_n
in order. (Much like append
, but for
strings, rather than lists.)
(string-length
str
)
str
.
(string-ref
str
pos
)
list-ref
, string-ref
presupposes zero-based indexing; the position is specified by
the number of characters that precede it in the string. Hence,
the initial character in the string is at position 0, the next
at position 1, and so on.)
(substring
str
start
end
)
start
to end
-1
of str
. Note that
substring
, like string-ref
uses 0-based indexing.
(string->list
str
)
str
to a list of characters.
The ith element of the list is the
ith character in the string.
(list->string
char-list
)
char-list
(which must be a
list of characters) to a string.
The ith element of the list becomes the
ith character in the string.
(string->number
str
)
"23"
or "3.14"
, or even
"2.11e-5"
), return the corresponding number.
(number->string
num
)
num
to an appropriate textual
representation.
(string<?
str1
str2
)
str1
lexicographically
precedes str2
.
Both str1
and str2
must be strings.
(string<=?
str1
str2
)
str1
is either the same as
str2
or if str1
lexicographically precedes str2
.
Both str1
and str2
must be strings.
(string=?
str1
str2
)
str1
is the same as
str2
.
Both str1
and str2
must be strings.
(string>=?
str1
str2
)
str1
is either the same as
str2
or if str1
lexicographically follows str2
.
Both str1
and str2
must be strings.
(string>?
str1
str2
)
str1
lexicographically
follows str2
.
Both str1
and str2
must be strings.
(string-ci<?
str1
str2
)
str1
lexicographically
precedes str2
, ignoring case.
Both str1
and str2
must be strings.
(string-ci<=?
str1
str2
)
str1
is either the same as
str2
or if str1
lexicographically precedes str2
,
ignoring case.
Both str1
and str2
must be strings.
(string-ci=?
str1
str2
)
str1
is the same as
str2
, ignoring case.
Both str1
and str2
must be strings.
(string-ci>=?
str1
str2
)
str1
is either the same as
str2
or if str1
lexicographically follows str2
, ignoring case.
Both str1
and str2
must be strings.
(string-ci>?
str1
str2
)
str1
lexicographically
follows str2
, ignoring case.
Both str1
and str2
must be strings.
Primary: [Front Door] [Schedule] - [Academic Honesty] [Instructions]
Current: [Outline] [EBoard] [Reading] [Lab] - [Assignment] [Quiz]
Groupings: [Assignments] [EBoards] [Examples] [Exams] [Handouts] [Labs] [Outlines] [Projects] [Quizzes] [Readings]
References: [A-Z] [By Topic] - [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [CSC151.01 2010S (Weinman)] [CSC151 2009F (Rebelsky)]
Misc: [SamR] [MediaScript] [GIMP]
Copyright (c) 2007-10 Janet Davis, Matthew Kluber, Samuel A. Rebelsky, and Jerod Weinman. (Selected materials copyright by John David Stone and Henry Walker and used by permission.)
This material is based upon work partially supported by the National Science Foundation under Grant No. CCLI-0633090. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
This work is licensed under a Creative Commons
Attribution-NonCommercial 2.5 License. To view a copy of this
license, visit http://creativecommons.org/licenses/by-nc/2.5/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.