diff options
author | Paul Phillips <paulp@improving.org> | 2012-10-01 02:11:26 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-10-01 02:12:31 -0700 |
commit | a191b3a229c2ec7d7d5d2dd7e3dce2ba95a83c1a (patch) | |
tree | 45dc66721471f98a23b47ab33a29559a3adc1b78 | |
parent | be49f36154efa78c3dcbeba394aa6ec2b5e764ec (diff) | |
download | scala-a191b3a229c2ec7d7d5d2dd7e3dce2ba95a83c1a.tar.gz scala-a191b3a229c2ec7d7d5d2dd7e3dce2ba95a83c1a.tar.bz2 scala-a191b3a229c2ec7d7d5d2dd7e3dce2ba95a83c1a.zip |
Fix StringContext documentation.
It doesn't call "new", as I discovered after some head
scratching.
-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 |