|
-
Professional Air Guitarist
trim($string) in Flash?
What is the operator equivilent to PHP's trim() in Flash?
-
The world goes - hm..
I've searched the Core Java script reference, and found none. It would be nice though...
You could search the java script places, because that's what Action Script is now!
( )
-
half as fun, double the price
-
Professional Air Guitarist
Thanks for that link...but where is the variable in this?
code:
String.prototype.ltrim = function() {
var i=-1;
while (this.charCodeAt(++i)<33);
return this.substring(i);
};
String.prototype.rtrim = function() {
var i = this.length;
while (this.charCodeAt(--i)<33);
return this.substring(0, ++i);
};
String.prototype.trim = function() {
return this.rtrim().ltrim();
};
Or is that JavaScript?
Last edited by Frag; 06-15-2003 at 04:54 PM.
-
Professional Air Guitarist
Nevermind...problem solved
-
Live And Let Live All
how to use the trim
How can I use the trim function.
lets say
Code:
String.prototype.ltrim = function() {
var i=-1;
while (this.charCodeAt(++i)<33);
return this.substring(i);
};
String.prototype.rtrim = function() {
var i = this.length;
while (this.charCodeAt(--i)<33);
return this.substring(0, ++i);
};
String.prototype.trim = function() {
return this.rtrim().ltrim();
};
var myVar=" abc ";
newVar = trim(myVar);
trace(newVar);
is this the way it will work ?
Last edited by sutar; 06-16-2003 at 03:39 AM.

______________________________________________

-
half as fun, double the price
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|