export default class StringBuilder { public constructor ( private value = '' ) { } public append ( s ) { if ( typeof s === 'string' ) { this . value += s . toString ( ) ; } else { this . value += String . fromCharCode ( s ) ; } return this ; } public length ( ) { return this . value . length ; } public charAt ( n ) { return this . value . charAt ( n ) ; } public deleteCharAt ( n ) { this . value = this . value . substr ( 0 , n ) + this . value . substring ( n + 1 ) ; } public setCharAt ( n , c ) { this . value = this . value . substr ( 0 , n ) + c + this . value . substr ( n + 1 ) ; } public toString ( ) { return this . value ; } }