JavaScript String Prototype (trim, ltrim, rtrim, replaceAll) 사용자 가이드
사용자 string prototype(trim, ltrim, rtrim, replaceAll)
trim
문자의 앞뒤 공백문자 제거
String.prototype.trim = function ()
{
  return this.replace(/^ *| *$/g, "");
}
ltrim
문자의 앞쪽 공백 제거
String.prototype.ltrim = function() {
  return this.replace(/^\s+/,"");
}
rtrim
문자의 뒤쪽 공백 제거
String.prototype.rtrim = function() {
  return this.replace(/\s+$/,"");
}
replaceAll
문자열 치환
String.prototype.replaceAll = function(searchStr, replaceStr)
{
  var temp_str = "";
  if (this.trim() != "" && searchStr != replaceStr)
  {
    temp_str = this.trim();
    while (temp_str.indexOf(searchStr) > -1)
    {
      temp_str = temp_str.replace(searchStr, replaceStr);
    }
  }
  return temp_str;
}