Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • \$\begingroup\$ DigitCharacter .. will save 1 byte \$\endgroup\$
    – DavidC
    Commented Feb 12, 2016 at 16:49
  • \$\begingroup\$ DigitCharacter doesn't work as written because it removes all the digits whereas we want to remove all the letters... \$\endgroup\$
    – A Simmons
    Commented Feb 12, 2016 at 18:18
  • 1
    \$\begingroup\$ you are right. I was thinking of Total@ ToExpression@StringCases[#, DigitCharacter ..] & \$\endgroup\$
    – DavidC
    Commented Feb 12, 2016 at 18:25
  • \$\begingroup\$ I see! Yeah that change saves a byte. \$\endgroup\$
    – A Simmons
    Commented Feb 12, 2016 at 18:33
  • \$\begingroup\$ 48 bytes by replacing Total with Tr \$\endgroup\$
    – hakr14
    Commented Nov 1, 2022 at 1:53