Concatenates this string and the specified string. @param string the string to concatenate @return a new string which is the concatenation of this string and the specified string.
(String string)
| 659 | * specified string. |
| 660 | */ |
| 661 | public String concat(String string) { |
| 662 | if (string.count == 0) { |
| 663 | return this; |
| 664 | } |
| 665 | |
| 666 | char[] buffer = new char[count + string.count]; |
| 667 | if (count > 0) { |
| 668 | System.arraycopy(value, offset, buffer, 0, count); |
| 669 | } |
| 670 | System.arraycopy(string.value, string.offset, buffer, count, |
| 671 | string.count); |
| 672 | return new String(0, buffer.length, buffer); |
| 673 | } |
| 674 | |
| 675 | /** |
| 676 | * Creates a new string containing the characters in the specified character |