diff options
author | michelou <michelou@epfl.ch> | 2008-02-22 12:31:23 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2008-02-22 12:31:23 +0000 |
commit | ecca8e2e67426bb43ad01edba87400c0dbd5799c (patch) | |
tree | 1f8166f417aa33c5bb0c547bb524f4c8a4cb7c4d /src/library | |
parent | 07c5d167ad0cde416217f19d3ecb342054a507a0 (diff) | |
download | scala-ecca8e2e67426bb43ad01edba87400c0dbd5799c.tar.gz scala-ecca8e2e67426bb43ad01edba87400c0dbd5799c.tar.bz2 scala-ecca8e2e67426bb43ad01edba87400c0dbd5799c.zip |
added Seq[Char] arg to append/insert
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/StringBuilder.scala | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/library/scala/StringBuilder.scala b/src/library/scala/StringBuilder.scala index 21ee6be62b..116ec53490 100644 --- a/src/library/scala/StringBuilder.scala +++ b/src/library/scala/StringBuilder.scala @@ -269,6 +269,22 @@ extends (Int => Char) with Proxy { } /** <p> + * Appends the string representation of the <code>Char</code> sequence + * argument to this sequence. + * </p> + * <p> + * The characters of the sequence argument are appended, in order, + * to the contents of this sequence. The length of this sequence + * increases by the length of the argument. + * </p> + * + * @param x the characters to be appended. + * @return a reference to this object. + */ + def append(x: Seq[Char]): StringBuilder = + append(x.toArray, 0, x.length) + + /** <p> * Appends the string representation of the <code>Char</code> array * argument to this sequence. * </p> @@ -494,6 +510,17 @@ extends (Int => Char) with Proxy { this } + /** Inserts the string representation of the <code>Char</code> sequence + * argument into this sequence. + * + * @param at the offset position. + * @param x a character sequence. + * @return a reference to this object. + * @throws StringIndexOutOfBoundsException if the offset is invalid. + */ + def insert(at: Int, x: Seq[Char]): StringBuilder = + insert(at, x.toArray) + /** Inserts the string representation of the <code>Char</code> array * argument into this sequence. * |