Skip to content

Instantly share code, notes, and snippets.

@hcliff
Last active August 29, 2015 14:05
Show Gist options
  • Save hcliff/e1efb6e3a2414c303068 to your computer and use it in GitHub Desktop.
Save hcliff/e1efb6e3a2414c303068 to your computer and use it in GitHub Desktop.
function finder(filename, string){
for(var ifilename = 0, istring = 0;ifilename<filename.length;ifilename++){
var cstring = string[istring],
cfilename = filename[ifilename];
// console.log(i, cstring, cfilename);
if(cstring == cfilename){
istring++;
if(istring == string.length)
return true;
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment