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;
}
/* 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
rape +='_';
}
rape += hand[x];
x++;
}
return rape;
}
Labels: strip javascript function strings