Skip to content

Instantly share code, notes, and snippets.

@Werninator
Created October 16, 2014 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Werninator/60d35764e78aa42973e3 to your computer and use it in GitHub Desktop.
Save Werninator/60d35764e78aa42973e3 to your computer and use it in GitHub Desktop.
Überprüft ob ein String eine Zahl enthält
/**
* hasNumber()
* Überprüft ob ein String eine Zahl enthält
*
* @type {String} str
* @return {boolean}
*/
function hasNumber(str) {
var regex = /\d/;
return regex.test(str);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment