Henrique Vicente

Friday, February 09, 2007

Strip me

The day after tomorrow I'm going to post a creatiful way I found to present many tables at once, now a function I'm using there, also you can see there :)

/* Strip before the first underline,
by Henrique Vicente

http://flickr.com/photos/henriquev/
Too cool to be copyrighted
Done after listening to Rape me, by Nirvana
To be used in production environment
Method: child(strip("real_string")); // returns string
*/

function strip(element)
{
var x=0, rape = '', hand = element.split('_');
while(x if(x>1) {
rape +='_';
}
rape += hand[x];
x++;
}
return rape;
}

Labels:



0 Comments:

Post a Comment

<< Home