Script language = "javascript">
Function JTRIM (STR)
{
VAR i = 0;
Var len = str.length;
IF (Str == ") Return (STR);
J = len -1;
Flagbegin = True;
Flagend = True;
While (Flagbegin == True && i
{
IF (Str.Charat (i) == "")
{
i = i 1;
Flagbegin = True;
}
Else
{
Flagbegin = false;
}
}
While (Flagend == True && J> = 0)
{
IF (str.Charat (j) == ""
{
J = J-1;
Flagend = True;
}
Else
{
Flagend = FALSE;
}
}
IF (i> j) Return ("")
Trimstr = Str.Substring (i, j 1);
Return Trimstr;
}
script>