/***********************************************************************
*              Author: Klaus Hentschel [ All rights reserved ].                        				   *
************************************************************************
* Copyright (C) by Klaus Hentschel, http//javarea.de
*
* www: http://javaera.de.de
*
* Dieses Script ist Bestandteil des JavBB 2.0.0
*
* - StringUtil.js
*
* - StringUtil() 					- spezielle Zeichen umwandeln
***********************************************************************/
/**
* Description: HTML spezialzeichen umwandeln
* Autor: Klaus Hentschel <javarea.de>
*
* StringUtil()
* @param: <string> str
* @return: <string> this.string
**/
function StringUtil(str)
{
  this.string = str;
  var searchStr,replaceStr;
  
  var turn = 1;
  while(turn<=3)
  {
    switch (turn)
    {
      case 1:
        searchStr = '&amp;';
        replaceStr = '&';
        break;
      case 2:
        searchStr = '&lt;';
        replaceStr = '<';
        break;
      case 3:
        searchStr = '&gt;';
        replaceStr = '>';
        break;
    }
    var re = new RegExp(searchStr, "g");
    this.string = this.string.replace(re, replaceStr);
  
    turn++;
  }
  
  return this.string;
}


/**
* Description: leerzeilen am Anfang und Ende entfernen
* Autor: Michael Lösler <derletztekick.com>
*
* trim()
* @prototype: <string>.trim
**/
String.prototype.trim = function()
{
  return this.replace(/^\s*|\s*$/g, "");
}

