mirror of
https://github.com/quinton-ashley/java2js
synced 2024-12-29 10:11:54 +01:00
20 lines
409 B
JavaScript
Executable File
20 lines
409 B
JavaScript
Executable File
jdk.imports['java.lang.StringBuilder'].load = async () => {
|
|
class StringBuilder {
|
|
constructor() {
|
|
this._str = '';
|
|
}
|
|
append(val) {
|
|
this._str = this._str + val;
|
|
return this;
|
|
}
|
|
insert(position, val) {
|
|
this._str = this._str.slice(0, position) + val + this._str.slice(position);
|
|
return this;
|
|
}
|
|
toString() {
|
|
return this._str;
|
|
}
|
|
}
|
|
jdk.java.lang.StringBuilder = StringBuilder;
|
|
};
|