Skip to content

Instantly share code, notes, and snippets.

@adeolaawoyemi
Created June 29, 2012 09:35
Show Gist options
  • Save adeolaawoyemi/3016923 to your computer and use it in GitHub Desktop.
Save adeolaawoyemi/3016923 to your computer and use it in GitHub Desktop.
parse list of videoIDs (and sanitise)
var playlist = "-123 ,456-, x789";
var videos = playlist.split(',');
var videos_count = videos.length;
for( var i = 0; i < videos_count; i++ ) {
// sanitise and remove non-numeric characters
var video_id = Number(videos[i].replace(/\D/g, ''));
// test
trace('videoID: [' + video_id + ']');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment