WelcomeServicesPortfolioKnowledge BaseContact Us
27 Seconds, Inc.


Knowledge base View Article

need hosting?

Need hosting? We use and love our host - CrystalTech.com!
Need hosting? We use and love our host - CrystalTech.com!

Text Disguise - CAPTCHA-image/Human Interactive Proof web services

National Holiday Dates and Bank Holiday Dates - web site that provides the dates of national and bank holidays for the United States, United Kingdom, Ireland and Scotland

Holiday Web Service - web services for programmers to provide the dates of national and bank holidays in their applications for the United States, United Kingdom, Ireland and Scotland

Our Family Heart - web site to help families communicate no matter where they are

What?! You haven't heard about the greatest remote controlled flyer to come out in years?! Checkout the FlyTech DragonFly now!

JavaScript LTrim()

Summary: Function that does the exact same as VBScript's LTrim.
 
Keywords: LTRIM
TRIM
Applicable Software: JavaScript
 
Body:

If you recognize this, yes it originally came from 4guysfromrolla.com.

function LTrim(str)
{
	// create a string that holds all possible white space values..
	var whitespace = new String(" \t\n\r");

	// create a String object from our value
	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;
}

 
Author: Douglas L. Setzer, II, http://www.27seconds.com
Posted On: 3/5/2002 11:52:39 AM

Rate this article: Average: 6.3
n/a12345678910
Comments?

Article Search   |   All Articles

 

 
©2002 27 Seconds, Inc. All Rights Reserved.