Skip to content
Chris Petersen edited this page Oct 16, 2014 · 1 revision

string->u8vector converts a string to a u8vector.

Parameter Description
str string to be converted

Example

Example 1: Transfer a string to u8vector and back.

> (define str "Once upon a time there was a little cow.")
> (define vec (string->u8vector str))
> (display vec)
#u8(79 110 99 101 32 117 112 111 110 32 97 32 116 105 109 101 32 116 104 101 114 101 32 119 97 115 32 97 32 108 105 116 116 108 101 32 99 111 119 46)
> (u8vector->string vec)
"Once upon a time there was a little cow."

This is the example

Clone this wiki locally