The string is probably the most frequently-used data structure in all languages. However, the idea and implementation of a string varies from language to language.
In Clojure, strings are text between a pair of "
(double quote) characters.
The '
(single quote) isn’t used to express strings in Clojure.
When we want to use double quotes within a string,
they must be escaped by \
(backslash).
Clojure strings have the type java.lang.String
.
This means Clojure strings can use all methods defined for java.lang.String.
See the Java API document: http://docs.oracle.com/javase/7/docs/api/java/lang/String.html.
Advice to coaches
This document doesn’t have a section for Java interoperability. Please talk about Java method invocation on Clojure briefly.
In addition to the methods of java.lang.String, Clojure functions also work for strings.
Advice to coaches
Links to string-related functions are listed in References. Tell attendees to try some other functions by looking at documents.
In Clojure, strings are seq-able.
Clojure functions for seq also work for strings.
When those functions are used on strings, Character
type values are returned.
Characters have the java.lang.Character
type and are expressed as \
followed by a single letter.
ClojureDocs
Clojure Documentation, Introduction to Clojure, Functions For Working With Strings
http://clojure-doc.org/articles/tutorials/introduction.html#functions-for-working-with-strings
Clojure from the ground up: basic types, Strings
http://aphyr.com/posts/302-clojure-from-the-ground-up-basic-types
Clojure for the Brave and True, 2.3 Strings
PCL -> Clojure, Chapter 10. Numbers, Characters, and Strings
http://thinkrelevance.com/blog/2008/09/19/pcl-clojure-chapter-10