summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/runtime/StringAdd.scala21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/library/scala/runtime/StringAdd.scala b/src/library/scala/runtime/StringAdd.scala
index 516a6f66ee..cf451403a7 100644
--- a/src/library/scala/runtime/StringAdd.scala
+++ b/src/library/scala/runtime/StringAdd.scala
@@ -1,9 +1,9 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
+/* *\
+** ________ ___ __ ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
+** /____/\___/_/ |_/____/_/ |_| **
+** **
\* */
// $Id$
@@ -16,4 +16,17 @@ import Predef._
final class StringAdd(self: Any) {
def +(other: String) = self.toString + other
+ /** Formats string according to given locale and format string. Formatstrings
+ * are as for String.format (@see java.lang.String.format)
+ */
+
+ def format(locale: java.util.Locale, format: String): String =
+ String.format(locale, format, Array(self.asInstanceOf[Object]))
+
+ /** Formats string according to given format string. Formatstrings
+ * are as for String.format (@see java.lang.String.format)
+ */
+ def format(format: String): String =
+ String.format(format, Array(self.asInstanceOf[Object]))
}
+