diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cldc-library/scala/runtime/StringAdd.scala | 22 | ||||
-rw-r--r-- | src/dotnet-library/scala/runtime/StringAdd.scala | 28 | ||||
-rw-r--r-- | src/library/scala/runtime/StringAdd.scala | 14 |
3 files changed, 58 insertions, 6 deletions
diff --git a/src/cldc-library/scala/runtime/StringAdd.scala b/src/cldc-library/scala/runtime/StringAdd.scala new file mode 100644 index 0000000000..ab74c6464b --- /dev/null +++ b/src/cldc-library/scala/runtime/StringAdd.scala @@ -0,0 +1,22 @@ +/* *\ +** ________ ___ __ ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ |_| ** +** ** +\* */ + +// $Id$ + + +package scala.runtime + + +import Predef._ + +final class StringAdd(self: Any) { + + def +(other: String) = self.toString + other + +} + diff --git a/src/dotnet-library/scala/runtime/StringAdd.scala b/src/dotnet-library/scala/runtime/StringAdd.scala new file mode 100644 index 0000000000..82cb751fff --- /dev/null +++ b/src/dotnet-library/scala/runtime/StringAdd.scala @@ -0,0 +1,28 @@ +/* *\ +** ________ ___ __ ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ |_| ** +** ** +\* */ + +// $Id$ + + +package scala.runtime + + +import Predef._ + +final class StringAdd(self: Any) { + + def +(other: String) = self.toString + other + + /** Formats string according to given <code>format</code> string. + * Format strings are as for <code>String.format</code> (@see + * http://msdn2.microsoft.com/en-us/library/system.string.format(VS.71).aspx + * and http://www.codeproject.com/books/0735616485.asp). + */ + def format(format: String): String = + String.Format(format, Array(self.asInstanceOf[Object])) +} diff --git a/src/library/scala/runtime/StringAdd.scala b/src/library/scala/runtime/StringAdd.scala index cf451403a7..a7da9a5d17 100644 --- a/src/library/scala/runtime/StringAdd.scala +++ b/src/library/scala/runtime/StringAdd.scala @@ -15,18 +15,20 @@ package scala.runtime 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) - */ + /** Formats string according to given <code>locale</code> and + * <code>format</code> string. Formatstrings are as for + * <code>String.format</code> (@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) + /** Formats string according to given <code>format</code> string. + * Format strings are as for <code>String.format</code> + * (@see java.lang.String.format). */ def format(format: String): String = String.format(format, Array(self.asInstanceOf[Object])) } - |