(s: string | number)
| 13 | } |
| 14 | |
| 15 | public append(s: string | number): StringBuilder { |
| 16 | if (typeof s === 'string') { |
| 17 | this.value += s.toString(); |
| 18 | } else if (this.encoding) { |
| 19 | // use passed format (fromCharCode will return UTF8 encoding) |
| 20 | this.value += StringUtils.castAsNonUtf8Char(s, this.encoding); |
| 21 | } else { |
| 22 | // correctly converts from UTF-8, but not other encodings |
| 23 | this.value += String.fromCharCode(s); |
| 24 | } |
| 25 | return this; |
| 26 | } |
| 27 | |
| 28 | public appendChars( |
| 29 | str: char[] | string[], |