Entry

flash trim functions

flash doesn’t have trim functions. Luckily for us someone else saved us time and made them
// parameters:
// matter, string to be trimmed
// returns:
// string, whitespaces removed from left side.
function ltrim(matter) {
if ((matter.length>1) || (matter.length == 1 && matter.charCodeAt(0)>32 && matter.charCodeAt(0)<255)) {
i = [...]

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • StumbleUpon
  • Google
  • Technorati
  • Slashdot
  • LinkedIn
  • E-mail this story to a friend!

flash doesn’t have trim functions. Luckily for us someone else saved us time and made them

// parameters:
// matter, string to be trimmed
// returns:
// string, whitespaces removed from left side.

function ltrim(matter) {
if ((matter.length>1) || (matter.length == 1 && matter.charCodeAt(0)>32 && matter.charCodeAt(0)<255)) {
i = 0;
while (i=255)) {
i++;
}
matter = matter.substring(i);
} else {
matter = “”;
}
return matter;
}

// parameters:
// matter, string to be trimmed

check it out:
http://www.19.5degs.com/element/238.php

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • StumbleUpon
  • Google
  • Technorati
  • Slashdot
  • LinkedIn
  • E-mail this story to a friend!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*