Skip to content

Instantly share code, notes, and snippets.

@marioluan
Last active December 17, 2015 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save marioluan/5583765 to your computer and use it in GitHub Desktop.
Save marioluan/5583765 to your computer and use it in GitHub Desktop.
Script para limpar codigo de barras.
var codigoSujo = prompt('Digite o número do código de barras');
var codigoLimpo = '';
// mantem somente letras e numeros
codigoLimpo = codigoSujo.replace(/\W/g, '');
alert('Aqui está o código de barras limpo: ' + codigoLimpo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment