diff options
author | Paul Phillips <paulp@improving.org> | 2012-10-01 07:48:12 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-10-01 07:48:12 -0700 |
commit | 1088af1236b64b89118e566ce3856b8101b391a9 (patch) | |
tree | 9c1efd3dc1f48c921ca4bed2af63373f6d8a3642 | |
parent | 1ddf34d0dcba266d4dbfa12a2b00c9699049299e (diff) | |
parent | a191b3a229c2ec7d7d5d2dd7e3dce2ba95a83c1a (diff) | |
download | scala-1088af1236b64b89118e566ce3856b8101b391a9.tar.gz scala-1088af1236b64b89118e566ce3856b8101b391a9.tar.bz2 scala-1088af1236b64b89118e566ce3856b8101b391a9.zip |
Merge pull request #1435 from paulp/stringcontext-doc
Fix StringContext documentation.
-rw-r--r-- | src/library/scala/StringContext.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/library/scala/StringContext.scala b/src/library/scala/StringContext.scala index d9f41f6002..fb43d56020 100644 --- a/src/library/scala/StringContext.scala +++ b/src/library/scala/StringContext.scala @@ -8,7 +8,7 @@ package scala -/** This class provides the basic mechanism to do String Interpolation. +/** This class provides the basic mechanism to do String Interpolation. * String Interpolation allows users * to embed variable references directly in *processed* string literals. * Here's an example: @@ -26,7 +26,7 @@ package scala * is rewritten to be: * * {{{ - * new StringContext("Hello, ", "").s(name) + * StringContext("Hello, ", "").s(name) * }}} * * By default, this class provides the `raw`, `s` and `f` methods as @@ -36,7 +36,7 @@ package scala * which adds a method to `StringContext`. Here's an example: * {{{ * implicit class JsonHelper(val sc: StringContext) extends AnyVal { - * def json(args: Any*): JSONObject = ... + * def json(args: Any*): JSONObject = ... * } * val x: JSONObject = json"{ a: $a }" * }}} @@ -72,7 +72,7 @@ case class StringContext(parts: String*) { * println(s"Hello, $name") // Hello, James * }}} * In this example, the expression $name is replaced with the `toString` of the - * variable `name`. + * variable `name`. * The `s` interpolator can take the `toString` of any arbitrary expression within * a `${}` block, for example: * {{{ @@ -98,7 +98,7 @@ case class StringContext(parts: String*) { * For example, the raw processed string `raw"a\nb"` is equal to the scala string `"a\\nb"`. * * ''Note:'' Even when using the raw interpolator, Scala will preprocess unicode escapes. - * For example: + * For example: * {{{ * scala> raw"\u0123" * res0: String = ģ @@ -133,7 +133,7 @@ case class StringContext(parts: String*) { * that starts with a formatting specifier, the expression is formatted according to that * specifier. All specifiers allowed in Java format strings are handled, and in the same * way they are treated in Java. - * + * * For example: * {{{ * val height = 1.9d |