From a191b3a229c2ec7d7d5d2dd7e3dce2ba95a83c1a Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 1 Oct 2012 02:11:26 -0700 Subject: Fix StringContext documentation. It doesn't call "new", as I discovered after some head scratching. --- src/library/scala/StringContext.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') 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 -- cgit v1.2.3