คัดลอกรหัสรหัสดังต่อไปนี้:
//#region ลบช่องว่าง
String.prototype.Trim = ฟังก์ชั่น () {
กลับ this.replace(/(^/s*)|(/s*$)/g, "");
-
String.prototype.LTrim = ฟังก์ชั่น () {
กลับ this.replace(/(^/s*)/g, "");
-
String.prototype.RTrim = ฟังก์ชั่น () {
กลับ this.replace(/(/s*$)/g, "");
-
//#endregion