JavaScript Common function Library __ function

Source: Internet
Author: User
Tags rtrim

/**/ /*
Name: Common.js
Function: Generic JavaScript script function library
Including:
1.Trim (str)--Remove the spaces on either side of the string
2.XMLEncode (str)--XML encoding of strings
3.ShowLabel (STR,STR)--Mouse prompt function (display character, prompt character)
4.IsEmpty (obj)--Verifying that the input box is empty
5.IsInt (Objstr,sign,zero)--Verifying whether an integer
6.IsFloat (Objstr,sign,zero)--Verify that it is a floating-point number
7.IsEnLetter (objstr,size)--Verify that it is 26 letters

Author: Shenwan
Date: 2004/04/14
*/

/**/ /*
==================================================================
String manipulation
Trim (String): Remove spaces on both sides of a string
==================================================================
*/

/**/ /*
==================================================================
LTrim (String): Removing space on the left
==================================================================
*/
function LTrim (str)
... {
var whitespace = new String ("");
var s = new String (str);

if (Whitespace.indexof (S.charat (0))!=-1)
... {
var j=0, i = s.length;
while (J < i && Whitespace.indexof (S.charat (j))!=-1)
... {
j + +;
}
s = s.substring (j, I);
}
return s;
}

/**/ /*
==================================================================
RTrim (String): Remove the space on the right
==================================================================
*/
function RTrim (str)
... {
var whitespace = new String ("");
var s = new String (str);

if (Whitespace.indexof (S.charat (s.length-1))!=-1)
... {
var i = s.length-1;
        while  (i >= 0 &&

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.