Skip to content

Strings

Amitai Erfanian edited this page Feb 2, 2021 · 8 revisions

String Methods

String Alphabetic

(string-alphabetic? [string]) -> boolean

Determines whether all ’letters’ in the string are alphabetic.

(string-alphabetic? "123")
#false


String Append

(string-append [string] [string] [string] ...) -> string

Concatenates the characters of several strings.

(string-append "hello" " " "world" " " "good bye")
"hello world good bye"


String Contains

(string-contains? [string] [string]) -> boolean

Determines whether the first string appears literally in the second one.

(string-contains? "at" "cat")
#true


String Copy

(string-copy [string]) -> string

Copies a string.

(string-copy "hello")
"hello"


String Downcase

(string-downcase [string]) -> string

Produces a string like the given one with all ’letters’ as lower case.

(string-copy "CaT")
"cat"


String Length

(string-length [string]) → natural

Determines the length of a string.

(string-length "hello world")
11


String Lower Case

(string-lower-case? [string]) → boolean

Determines whether all ’letters’ in the string are lower case.

(string-lower-case? "hello world")
#true


String Numeric

(string-numeric? [string]) → boolean

Determines whether all ’letters’ in the string are numeric.

(string-numeric? "123")
#true


String Upcase

(string-upcase [string]) → string

Produces a string like the given one with all ’letters’ as upper case.

(string-upcase "cAt")
"CAT"


String Upper Case

(string-upper-case? [string]) → boolean

Determines whether all ’letters’ in the string are upper case.

(string-upper-case? "HELLO WORLD")
#true


String Whitespace

(string-whitespace? [string]) → boolean

Determines whether all ’letters’ in the string are white space.

(string-whitespace? " ")
#true


Clone this wiki locally