Is the symbol hyperbola a string?
Is the character #\A a string?
Does the null string count as a string?
Suggest two ways of constructing the string ??? -- one
using a call to make-string, the other a call to
string.
Here are two opposing views about the relationship between
string-length and string-ref:
``No matter what string str is, provided that it's not the
null string, (string-ref str (string-length str)) will return
the last character in the string.''
``No matter what string str is, (string-ref str
(string-length str)) is an error.''
Which, if either, of these views is correct? Why?
Write a Scheme procedure tally-vowels that takes one
argument,
a string, and determines how many characters in that string are vowels.
(For this purpose, you should count only the ten characters
#\a, #\e, #\i, #\o,
#\u, #\A, #\E, #\I,
#\O, and #\U as vowels.)
Write a Scheme procedure consonant-part that takes one
argument, a string, and returns a string similar to its argument except
that all of the vowels have been removed. (For instance, the value of
(consonant-part "asparagus") should be "sprgs".)
This document is available on the World Wide Web as
http://www.cs.grinnell.edu/~gum/courses/151/labs/strings.xhtml
created March 5, 1997
last revised August 11, 2001
Henry Walker (walker@math.grin.edu) and John David Stone (stone@cs.grinnell.edu) and Ben Gum (gum@cs.grinnell.edu)