|
|
|
javascript เชคค่าว่างตรง space ไงครับ พอกดเคาะ กลับใส่ได้เฉยเลย |
|
|
|
|
|
|
|
Code (JavaScript)
function trim(str, chars) {
return ltrim(rtrim(str, chars), chars);
}
function ltrim(str, chars) {
chars = chars || "\\s";
return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
function rtrim(str, chars) {
chars = chars || "\\s";
return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}
|
|
|
|
|
Date :
2010-08-20 22:14:57 |
By :
no-login |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|