previous up next     contents index
Next: Syntax Rules Up: Libraries Previous: MrSpidey

Strings

  Files: ``strings.ss'', ``stringsu.ss'', ``stringss.ss'', ``stringsc.ss''
Signature: mzlib:string tex2html_wrap_inline2054
Unit:  mzlib:string@

 

(eval-string str err-display err-result) (procedure)

Reads the string str as an S-expression, evaluates it, and returns the result. If str contains multiple S-expressions, they are all read and only the final result is returned.

The err-display and err-result arguments are optional; if err-display is not #f, then errors are caught and err-display is used as the error display handler. If err-result is specified, it must be a thunk that returns a value to be returned when an error is caught; otherwise, #f is returned when an error is caught.

 

(expr->string expr) (procedure)

Prints expr into a string and returns the string.

 

newline-string (string)

A string containing a single newline character.

 

(read-string str err-display err-result) (procedure)

Reads the first S-expression from the string str and returns it. The err-display and err-result are as in eval-str.

 

(read-string-all str err-display err-result) (procedure)

Reads all S-expressions from the string str and returns them in a list. The err-display and err-result are as in eval-str.

 

(regexp-match-exact? regexp str) (procedure)

This procedure is like MzScheme's built-in  regexp-match, but the result is always #t or #f; #t is only returned when the entire string str matches regexp.

 

(string-lowercase! str) (procedure)

Destructively changes str to contain only lowercase characters.

 

(string-uppercase! str) (procedure)

Destructively changes str to contain only uppercase characters.



PLT