Skip to main content
1 of 8
Jörg Hülsermann
  • 13.3k
  • 3
  • 15
  • 36

PHP, 29 Bytes

<?=strlen($argn)-($argn<"0");

Try it online!

PHP, 32 Bytes

<?=preg_match_all("#\d#",$argn);

35 Bytes

<?=strlen($argn)-strspn($argn,"-");
Jörg Hülsermann
  • 13.3k
  • 3
  • 15
  • 36