[Question]
  [
# What?
*Many programming languages, both practical and esoteric, have functions, methods, etc to convert a given string to a decimal number.* This is how the process might work:
* For each character in the given string.
	+ Take the character's ASCII value and subtract it by 48.
	+ Multiply the output value by 10. (The output at the first iteration is 0)
	+ Add the subtracted ASCII value to the output.
Let us do this process for the string `"109"`:
1. The ASCII value of `1` is 49. Subtract it by 48, and we get 1. We multiply the output by 10, we get 0. Finally, we add 1 to 0 and get one.
2. Next, we subtract `0`'s ASCII value (48) by 48, we get 0. We multiply 1 by 10, we get 10. Nothing happens when we add 0.
3. Then we subtract `9`'s ASCII value (57) by 48, we get 9. We multiply 10 by 10 and get 100. We add 9 to 100 and get 109.
There, we successfully converted `"109"` to 109! It is just as simple!
The problem is that most languages do not like it when the converting string has non-digital characters (characters with an ASCII value not in the range 48-57 inclusive). They would most likely throw some nasty errors or exceptions at us.
*How 'bout we ignore that!*
# Task
Given a printable string from STDIN (you can assume that \$1 ‚â§ \text{Input Length} ‚â§ 10\$), implement a program or function to badly convert it to an integer according to the above steps, and output or return it back.
Strings can contain whitespace characters (Spaces, tabs and linefeeds).
For another example string `"Hi!"`:
1. The ASCII value of `H` is 72:  
`72 - 48 = 24`  
`0 * 10 = 0`  
`0 + 24 = 24`
2. The ASCII value of `i` is 105:   
`105 - 48 = 57`   
`24 * 10 = 240`   
`240 + 57 = 297.`
3. The ASCII value of `!` is 33:   
`33 - 48 = -15`   
`297 * 10 = 2970`   
`2970 + -15 = 2955`
This means that `"Hi!"` converted to an integer is 2955!
Standard I/O rules apply.
*Note: if your language does not support input, feel free to tell me in your answers (you can put the "input" strings in your source code)!*
# More test cases
```
STDIN                  Output
"123456789"         ->  123456789
"0123456789"        ->  123456789
"-12345"            -> -287655
"Lorem"             ->  350191
"Ipsum"             ->  321451
"AAAAAAAA"          ->  188888887
"        "          -> -177777776
"A"                 ->  17
" "                 -> -16
"
"                   -> -38
```
Standard [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") rules apply!
  
[Answer]
# [Shakespeare Programming Language](https://github.com/TryItOnline/spl), ~~258~~ 252 bytes
-6 bytes thanks to [the default](https://codegolf.stackexchange.com/users/36445/the-default).
```
,.Ajax,.Puck,.Act I:.Scene I:.[Exeunt][Enter Ajax and Puck]
Ajax:Open mind.
Puck:Is I nicer zero?If soYou is the sum ofI twice the difference 
     betweenthe product ofyou the sum ofa cat a big big cat the factorial 
     ofa big big cat.
     If soLet usAct I.Open heart
```
[Try it online!](https://tio.run/##TY9NCgIxDIWv8g4w9ACzERcuCoKCKxEXtZM6VScd2hR/Lj@23egikPfyJbyk@bEsnVrfzKtT@2zvpbcC3auDJabanDYvyizn04aFIioKwwMqfa6q383EmDwP7UKvEzTY2wJ/KIaVdkjhGDJ8goyElCcEpyHPwjRn8M5RJC7yQvIk4urOMQy5hAnuXZZ/mwbWCAwu/tqqqjp1xkqI3jwa8zdVLcGWBDm171RLPJKJsizbEGn6Ag "Shakespeare Programming Language ‚Äì Try It Online")
The golfiest representation of the integer 48 is as `twice the factorial of a big big cat`, i.e. \$48=2\times (2\times2\times1)!\$.
This corresponds to
```
Ajax = 0
Puck = 0
Begin Act I
Puck = read_input (as ASCII codepoint value)
if(Puck>0){
    Ajax = Puck + 2 * (Ajax * (4+1) - 4!)
    Go to Act I
}
print(Ajax) (as an integer)
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 bytes
```
O_48·∏å
```
[Try it online!](https://tio.run/##y0rNyan8/98/3sTi4Y6e/4fbHzWt@f9fySNTUUlHQckRCkBsQyNjE1MzcwtLJQA "Jelly ‚Äì Try It Online")
## How it works
```
O_48·∏å - Main link. Takes a string s on the left
O     - Convert to ordinal code points
 _48  - Subtract 48 from each
    ·∏å - Convert from base-10
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), 8 bytes
As long as we're doing things wrong, why not turn a string into a polynomial?
```
48-[X]ZQ
```
[Try it online!](https://tio.run/##y00syfn/38RCNzoiNirw/391n/yi1Fx1AA "MATL ‚Äì Try It Online")
Evaluates the polynomial
$$p\_1x^{n-1} + \cdots + p\_{n-1}x^1 + p\_nx^0$$
where \$p\$ is the input string (minus '0') and \$x\$ is 10.
[Answer]
# [Poetic](https://mcaweb.matc.edu/winslojr/vicom128/final), 153 bytes
```
decoding a num got WRONG
I/O digits i get?converting fails,o darn
i am bummed if the I/O fails
i have a number i got based on counting it badly,i suppose
```
[Try it online!](https://mcaweb.matc.edu/winslojr/vicom128/final/tio/index.html?JY07DoMwEER7TjEHQIqSHCBllCZIaVKv8WJWwl7kDxKnJzZpZ968sTyqleBACMXDacb3M7yf3esywIqTnCBwnB@jho1jbuxEsqReYSmGTkAepnjPFjIhz4y2PZlazrTxX244NlV9MJQqrAGjlnAapYV22XtBKuuqiY/r7X7U7Ac)
[Answer]
# [JavaScript (ES6/2015)](http://www.ecma-international.org/ecma-262/6.0/), 43 bytes
```
s=>s.map(c=>r=r*10+c.charCodeAt()-48,r=0)|r
```
```
let f = s=>s.map(c=>r=r*10+c.charCodeAt()-48,r=0)|r
console.log(f([..."123456789" ])) //  123456789
console.log(f([..."0123456789"])) //  123456789
console.log(f([..."Lorem"     ])) //  350191
console.log(f([..."Ipsum"     ])) //  321451
console.log(f([..."AAAAAAAA"  ])) //  188888887
console.log(f([..."        "  ])) // -177777776
console.log(f([..."A"         ])) //  17
console.log(f([..." "         ])) // -16
```
[Try it online!](https://tio.run/##jcy9DoIwFIbh3atomIpK4SA/ZSgJcTLxDoxDU8GfgCUtMnnvGAPSRDv4jifP@W6851qoa9t5PR0qNmiWa9LwFguWK6aWEKwEEReutvJUFh12vYiuFQvcpxqEvGtZl6SWZ1zhAyHEgXATxUlKMwcdXRf5PkLzaWHxgXn4y@@lKhsHvfv4TRxABja8a/XjG4cQxVZcTDkGAx1LbR5NGe9BOpZY9@cPs28f/oEeJMML "JavaScript (V8) ‚Äì Try It Online")
**Edit #1:** -1 byte thanks to [l4m2](https://codegolf.stackexchange.com/users/76323/l4m2)
**Edit #2:** -7 bytes thanks to [EzioMercer](https://codegolf.stackexchange.com/users/116593/eziomercer)
[Answer]
# [R](https://www.r-project.org/), ~~51~~ 48 bytes
*Edit: -3 bytes thanks to Robin Ryder*
```
function(s)(utf8ToInt(s)-48)%*%10^(nchar(s):1-1)
```
[Try it online!](https://tio.run/##hc5dC4IwFAbge3/FMIQtGHj8nEFBl0KXXSdiakJuMZV@vkmalBzpvdt2nr1H99c8q@r0npRK5slTK1nu@6KTWVspSRtGu7YQZxXLdjhwTzBra4F9oTK7pXq42gEHhnxCTXBczw9CEZmMbMgUfiBkfjAwZmPuPzspndffTR/m@jZEgJr40XS4ccDzcXOc8sPe64kxIcqmwaXiEI4J8LLlcnPZSsvKPIfA6F8 "R ‚Äì Try It Online")
Multiplies Utf8 value of each character minus 48 by powers-of-ten from the length of the string minus one, down to zero, and outputs the sum.
[Answer]
# [Python 3](https://docs.python.org/3/), ~~46~~ ~~45~~ 42 bytes
```
f=lambda s:s>[]and ord(s.pop())-48+10*f(s)
```
[Try it online!](https://tio.run/##VY3BCoJAFEXXzVc8hOHNlIallQkGLYP@oFoYOiSoM/hei77ecnDTXZ17Fve6D79sn4yjKdqye1YlUE6n26PsK7BDpWjtrFNaR2m22sRLo0iPXBMTFKAEbrZJutsfsiOGAuO/Fvk20dUOdTfBxdHbw3nOxDDHey9QaCGMHYCh6cG/5WLhhqZnhfK3SygVBpIClKxDMKptiBVrHVLtCrwz6vEL "Python 3 ‚Äì Try It Online")
-1 thanks to Sisyphus
-3 taking a list of characters as input thanks to ovs
[Answer]
# [Scala](http://www.scala-lang.org/), 18 bytes
```
_./:(0)(_*10+_-48)
```
[Try it online!](https://tio.run/##K05OzEn8n5@UlZpcouCbmJmnkFpRkpqXUqzgWFBQzVWWmKOQZqUQXFKUmZeuYGun4JlXomD7P15P30rDQFMjXsvQQDte18RC838BUEVJTp5GmoaSR6aikqYmF5KIoZGxiamZuYUlmrhPflFqLpqYAohf@x8A "Scala ‚Äì Try It Online")
Explanation:
```
_./:(0)(_*10+_-48)
  /:                Fold left
_                   the input string
    (0)             with an initial value of 0
       (_*10+_-48)  Multiply the accumulator by 10, and add the next character - 48
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 13 bytes
```
·∫°-‚ÇÑ‚Çà·µê{√ó‚ÇÅ‚ÇÄ ∞+}À°
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/pfXa6koGunoFRu/6htw6Ompoe7Omsfbp3w/@GuhbqPmloeNXUAedWHpz9qanzU1HBqg3bt6YX//0crGRoZm5iamVtYKukoGSBzdMEcIMMnvyg1F0h7FhSXgmhHKAAyFaAAJAriKsUCAA "Brachylog ‚Äì Try It Online")
For single-"digit" inputs, the output is wrapped in a list, since the fold isn't actually executed. If this isn't acceptable, two 15-byte alternatives exist:
[`·∫°-‚ÇÑ‚Çà·µê,0‚Üª{√ó‚ÇÅ‚ÇÄ ∞+}À°`](https://tio.run/##SypKTM6ozMlPN/pfXa6koGunoFRu/6htw6Ompoe7Omsfbp3w/@GuhbqPmloeNXUAeToGj9p2Vx@e/qip8VFTw6kN2rWnF/7/H61kaGRsYmpmbmGppKNkgMzRBXOADJ/8otRcIO1ZUFwKoh2hAMhUgAKQKIirFAsA)
[`·∫°‚Üî-‚ÇÑ‚Çà·µê{i√ó‚ÇÅ‚ÇÄ‚Å±‚Åæ}·∂†+`](https://tio.run/##SypKTM6ozMlPN/pfXa6koGunoFRu/6htw6Ompoe7Omsfbp3w/@GuhY/apug@amp51NQBFKjOPDz9UVPjo6aGR40bHzXuq324bYH2///RSoZGxiamZuYWlko6SgbIHF0wB8jwyS9KzQXSngXFpSDaEQqATAUoAImCuEqxAA)
```
·∫°                Convert to codepoints.
 -‚ÇÑ‚Çà·µê            Subtract 48 from each.
     {     }À°    Left fold:
      √ó‚ÇÅ‚ÇÄ ∞       multiply the accumulator (initialized to first element) by 10
          +      and add it to the next element.
```
Brachylog's base conversion builtin actually disallows values outside the usual range, because it's actually quite useful sometimes on top of preserving proper inverse behavior, so I'm forced to implement the described algorithm directly.
[Answer]
# [PowerShell Core](https://github.com/PowerShell/PowerShell), ~~35~~ 26 bytes
```
$args|%{$r=$r*10+$_-48}
$r
```
Saved 9 bytes using splatting
[Try it online!](https://tio.run/##K8gvTy0qzkjNydFNzi9K/a@SpmCrUP1fJbEovbhGtVqlyFalSMvQQFslXtfEopZLpeh/LReXShlQkZKhkbGJqZm5haUSlxpQm0MZTMIAp4wuWEZJAQLQJH2A9ufC5NAlPQuKS3FKOkKBEjZJmB50tziiCyBU/AcA "PowerShell Core ‚Äì Try It Online")
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 11 [bytes](https://github.com/abrudz/SBCS)
```
10‚ä•48-‚ç®‚éïUCS
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R2wRDg0ddS00sdB/1rnjUNzXUOfg/kFIASiikKagbGhmbmJqZW1iqKyg86p2roAAX4EJSZYCkDLcqn/yi1FygOSAAVmVsamBoaYisxLOguBRViZGhiSmKEkcoUIcpMbSAAHNkVQpQAFOla2gOAWYoZsHVwcxCNQRNWtfQ7D8A "APL (Dyalog Unicode) ‚Äì Try It Online")
`‚éïUCS` converts string to a vector of ASCII values, `48-‚ç®` subtracts 48 from each value and `10‚ä•` converts from base 10.
[Answer]
# Java 8, 46 bytes
```
a->{int r=0;for(var c:a)r=r*10+c-48;return r;}
```
Input as a character-array.
[Try it online.](https://tio.run/##TVDBToNAEL3zFeOeQIRQrVohmDS9aKK99Gg8jNutboWFzC6YhvDtuAvUOIeZ914mb17miC1Gx/33wAvUGl5Rqs4DkMoIOiAXsHV0FID7/Avp7R0wyKzYe7Zpg0Zy2IKCHAaMHju3SXmSHSryWyTgKQaU0@UiCXm0XGUkTEMKKOuHzDnUzUdhHWajtpJ7KG0Kf2dIqs/x2hTBGU4iGKHNBrWAFJT4gfNqx57kBbtii@ub5e3d/erB4uQ/iUZiwUtForTzudaNm@u5LIS5nOoo6wNvUnYnbUQZV42Ja3vQFMo/BwlZCixUMf9TYlNt7LfWRHjyg2D@WD/8Ag)
**Explanation:**
```
a->{            // Method with character-array parameter and integer return-type
  int r=0;      //  Result-integer, starting at 0
  for(var c:a)  //  Loop over the input-characters:
    r=          //   Change the result to:
      r*10      //    The current result multiplied by 10
      +c-48;    //    And add the codepoint of the current characters minus 48
  return r;}    //  After the loop, return the result
```
[Answer]
# [Haskell](https://www.haskell.org/), ~~45~~ 43 bytes
```
n#(h:t)=(n*10+fromEnum h-48)#t
n#_=n
f=(0#)
```
[Try it online!](https://tio.run/##dYzBjoIwEIbvPsWk7KGztAlFCmi2m@zBg4mePBpjOEjYaAspkOWw744tGA8m/ofJzPf9mapor5fbbRxNQKt1h4qaTxGFpa31xvQaKp7kGHQLE5yVWZSKRgGOuvg1oEAXzf4MTd8dOrszcIQBwhAIqG833Ebbqv6DDyhhwNnwF0OdAlQKLP7TgVn84kdKRLxMZJrlK8KeKzJKoneCTxdhPM6zVEqPdrW9aMKWMhIr4cG2aXsPYpHICfw84n7lczKP4RH3TWRz0qnuenPBmxRPp/EO "Haskell ‚Äì Try It Online")
```
n#(h:t)=       - # -> infix function taking a number and a string(head:tail)
(n*10+fromEnum h-48)#t  
                 - compute first char and call recursively on tail
n#_=n          - end condition
f=(0#)         - apply 0 to #
```
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal), 5 bytes
```
C48-I
```
[Try it Online!](http://lyxal.pythonanywhere.com?s=?flags=&code=C48-I&inputs=Lorem&header=&footer=)
Wow it's actually ASCII.
[Answer]
# [Assembly (NASM, 32-bit, Linux)](https://www.nasm.us/), ~~221~~ ~~185~~ 147 bytes
*Edit: -36 bytes + bugfix*
*Edit: -38 bytes*
```
mov edi,0
push 48
l:imul edi,edi,10
add edi,[esp]
sub edi,48
mov edx,1
mov ecx,esp
mov ebx,0
mov eax,3
int 128
mov ax,[esp]
xor ax,10
jnz l
pop eax
```
[Try it Online!](https://jdoodle.com/a/2rRk)
The result is in `edi`.
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 7 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
√´k‚ïúŒìO√≠U
```
[Run and debug it](https://staxlang.xyz/#p=896bbde24fa155&i=%22123456789%22%0A%220123456789%22%0A%22Lorem%22%0A%22Ipsum%22%0A%22AAAAAAAA%22%0A%22++++++++%22%0A%22A%22%0A%22+%22&m=2)
Explanation:
```
{48-mA|E Unpacked source, implicit input
{   m    Map over code points of input string
 48-       Subtract 48 from each
     A|E Convert from base 10
```
[Answer]
# [Perl 5](https://www.perl.org/), 40 bytes
```
sub{my$r;map$r=$r.0-48+ord,pop=~/./g;$r}
```
[Try it online!](https://tio.run/##bZBRa4MwFIXf/RVZCEOZtsaaqg0p3dsG3dvexigbjSJME6LCpHR/3Wm0Oteet3vOl3PDlVx9kSarAYpZU1Sfp6xGimYfEimG1MJ1/PBBqKMthWQ/y8UyoUidG2pUBQevvCg3mxehODXahl3Zzsw0QKs3@JTeQTAX2wLgRYS82wODvZVP1kEYwRkz2iPoXpO3wX37mQxebV0RF0d4pJ5lUd2iPOyTiXocBOcUDnsFI3hJ56CDg17rqfH/RYbGP1U3CQdfOixqxEKZ@tTWSVtZbaI0lzbi39JiO3Sggw1QIkp2j2KdW5Od5rFgsDOB42w1Bvs0Lcxu0l225tpnZ@Mocn7oVqZ5Qptf "Perl 5 ‚Äì Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~48~~ 44 bytes
Usually using a temporary variable to store the current character is shorter than doing array processing, but not this time!
```
i;f(char*s){for(i=0;*s;i=i*10+*s++-48);s=i;}
```
[Try it online!](https://tio.run/##VU3NTsJAEL7PU4wYwm5LTYuAmHVJvGniGwgHbHdhknaXdIoHSZ@97lYT45y@@X7L7FiWw0DKivJ0aBOWV@tbQTpXCSvSlBR5mnCaZsuNVKxJ9cMtubK@VAafuKvI35228I@q6SNyQK7D5kBOfHqqJF4BMW4gvy9W672C8McthfZoOhY8R6Yv461gGWCodlL9xDBkuGtr44KWFXs92@UzNQrnNsxYMZky6i1Oq52bhPAcY4uMlh764YVuoFjcL1frh80j5H/wzbemgdczXxp4/r2xNh4ECNlohm8 "C (gcc) ‚Äì Try It Online")
[Answer]
# [J](http://jsoftware.com/), 12 bytes
```
10#._48+3&u:
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/DQ2U9eJNLLSN1Uqt/mtypSZn5CtoWKdpKqgbGhmbmJqZW1iqI4saYBfWBQujCPnkF6Xmooh4FhSXooo4QgGKoAIUoKpEVaL@HwA "J ‚Äì Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), 53 bytes
```
def f(x):
 o=0
 for i in x:o=o*10+ord(i)-48
 return o
```
[Try it online!](https://tio.run/##TY7BDsIgEETvfMXKCdQm1FatTTh408Q/MN4KSqIsAZrUr0fQHpzLzJs97Lh3fKBtUhqUBs0m3hNAKQho9GDAWJh6lLisxQr9wAyv2o6AV3H0FjA9TYjySk9mQde03jTtdrfvDjmLf6i@kMMFvXplP7swFj/OyhFmlbYgvZEyIURv7L3sKK/yOJc5Ms1@B87TBw "Python 3 ‚Äì Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~¬†39¬†~~ 38 bytes
*Saved 1 byte thanks to @Shaggy*
```
s=>Buffer(s).map(c=>p=p*10+c-48,p=0)|p
```
[Try it online!](https://tio.run/##hcy9CsIwGIXh3asImRI1bb7a3yEF3QRvosRElLYJjXXy3ivSEiEdfMfDw3k0r8bJ4W6frDdXNWkxOVGfRq3VQByNusYSKWor7Bb4TrK03FvB6dtO0vTOtCpqzY1ogiE5pFlelBVGlKI4Rsgvm4Dyn/1HL2ZQHUbfFnrIOFQQurN1Y@ASSLOVOy5h76CcK0KKljxlUMzlq1eP/ev6LjQM8ukD "JavaScript (Node.js) ‚Äì Try It Online")
[Answer]
# [K (ngn/k)](https://bitbucket.org/ngn/k), 7 bytes
```
10/-48+
```
[Try it online!](https://tio.run/##y9bNS8/7/z/NytBAX9fEQvt/mrqGkqGRsYmpmbmFpZK1gpIBCk8XzAOxfPKLUnNBDM@C4lIwwxEKQGwFKACLgwWUNEH8/wA "K (ngn/k) ‚Äì Try It Online")
[Answer]
# [brainfuck](https://github.com/TryItOnline/brainfuck), ~~43~~ 38 bytes
```
,[<[>++++++++++<-]>+++>+[<->+++++],]<.
```
[Try it online!](https://tio.run/##SypKzMxLK03O/v9fJ9om2k4bDmx0Y0E8O@1oG12IcKxOrI3e//9mpgA "brainfuck ‚Äì Try It Online")
Thanks to JosiahRyanW for -5 bytes.
Since by our consensus, [output can be given as character code](https://codegolf.meta.stackexchange.com/questions/4708/can-numeric-input-output-be-in-the-form-of-byte-values/4719#4719), this is pretty straightforward in brainfuck. Note that the brainfuck interpreter on tio.run has 8-bit wrapping cells, so the maximum value is 255.
```
,[                  while input
  <[>++++++++++<-]  add 10 times previous sum to input
  >+++>+[<->+++++]  add 208 to it (effectively subtracting 48 by 8 bit wrapping)
  ,                 read next character
]
<.                  output
```
[Answer]
# [Befunge-98 (PyFunge)](https://pythonhosted.org/PyFunge/), ~~14~~ 12 bytes
Thanks to [Gegell](https://codegolf.stackexchange.com/users/80503/gegell) for -2 bytes!
```
2j@.~'0-\a*+
```
[Try it online!](https://tio.run/##S0pNK81LT9W1tNAtqAQz//83ynLQq1M30I1J1NL@/98nvyg1FwA "Befunge-98 (PyFunge) ‚Äì Try It Online")
**Explanation**:
Initially the instruction pointer (IP) is moving right and the stack is filled with `0`'s.  
`2j` skips the next two instruction (`@.`).  
`~` reads one character of input.  
`'0-` subtracts 48 from the input.  
`\` swaps the two elements at the top of the stack. Now the intermediate result is on the top.  
`a*` multiplies the result by 10.  
`+` adds the new number.  
If there is no input left `~` reflects the IP.  
`.` prints the result at the top of the stack, and `@` terminates the program.
Animation of the code with input `Lorem`:
[![enter image description here](https://i.stack.imgur.com/tGGzb.gif)](https://i.stack.imgur.com/tGGzb.gif)
I'm not sure why there are black bars on two frames, I blame ImageMagick :/
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 6 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
√á48-TŒ≤
```
Similar as some other answers.
[Try it online](https://tio.run/##yy9OTMpM/f//cLuJhW7IuU3//3tkKgIA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeX/w@0mFroh5zb91/kfreSRqaiko2RoZGxiamZuYQlkGyBzdMEcIMMnvyg1F0h7FhSXgmhHKAAyFaAAJAriKsUCAA).
**Explanation:**
```
√á       # Convert the (implicit) input-string to a list of codepoint integers
 48-    # Subtract 48 from each value
    TŒ≤  # Convert this from a base-10 list to a base-10 integer
        # (after which it is output implicitly as result)
```
[Answer]
# [Rust](https://www.rust-lang.org/), 42 bytes
```
|s|s.chars().fold(0,|n,x|n*10+x as i32-48)
```
[Try it online!](https://tio.run/##VcpNCsIwEEDhvacYu5AZTUrS1loVvYoETbBQI2YiFIxnjz8LweV7fOHOMTsPF9N7pAcMNoLbOI8zjoHkvq8r2EFOnLg8nk1gpNJdhxMqkbwYk59rtRjBMLylbDrK24lhtiEe7G2KuqqbZbvq1sJhoX5VEP0xqdsPgO9/5hc "Rust ‚Äì Try It Online")
Takes input as an &str and outputs the number based on utf-8 codepoints.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 38 bytes
```
->s{s.bytes.inject(0){|a,b|b-48+a*10}}
```
35 bytes with the new Ruby 2.7 syntax:
```
->s{s.bytes.inject(0){_2-48+_1*10}}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1664ulgvqbIktVgvMy8rNblEw0CzuiZRJ6kmSdfEQjtRy9CgtvZ/gUJatJKhkbGJqZm5haVSLBdYwABDRBcsAuP55Bel5sI4ngXFpXCOIxTA@ApQAJeHSyjF/gcA "Ruby ‚Äì Try It Online")
[Answer]
# [><>](http://esolangs.org/wiki/Fish), 15 bytes
```
0l1=?na*{68*-+!
```
[Try it Online!](https://tio.run/##S8sszvj/3yDH0NY@L1Gr2sxCS1db8f///7rFPvlFqbkA)
Explanation
```
0             !         Accumulator initialisation, skipped on subsequent loops
 l1=?na*                Print-and-terminate condition
      a*                Decimal shift
        {               Next character of input
         68*-+          Subtract 48 and add
```
[Answer]
# [Clojure](https://clojure.org/), 41 bytes
```
#(reduce(fn[x y](+(* 10 x)-48(int y)))0%)
```
[Try it online!](https://tio.run/##jZDdCoJAEIXv9ymGjWC2WnDV9Ycg6DLoDcQr3YXC1DRBn94sNUu86FwNcz7ODCdKsmtVqBZjpUG3KyxUXEUKdRrU0IS4xQ0IA2rGbQ8v6QMaxpixZi0jGGelukNQk4AK07Kl43o@3cGgPT8AfPaEGn8w/D1P/shw03MdKQk9Z4W6/fp9iCUN4QtCT3lZLQOmsGUHHAd9M/0bXi@X0HE/Z7hwezldzuzIlPMKoGG4ZHLhEMyLrsckBdRdrYy1Tw "Clojure ‚Äì Try It Online")
Or alternatively, for the same byte count with a different order of full and shorthand function notation:
```
(fn[x](reduce #(+(* 10%)-48(int %2))0 x))
```
[Try it online!](https://tio.run/##jZDdCoJAEIXv9ymGDWG2WnDV9Ycg6DLoDcQr3YXC1DTBtzdNzRIvOlfDnI8zw4nT/FaXqsVEadAt6ixsIixVUscKNrjDLQjTYNzx8Zo9wbAYM6FhrGUEk7xSDwgbElJh2Y50PT@gexh14EeAz55Q8w@Gv@fZnxhu@Z4rJaGXvFT3X38IsaUpAkHouajqdcASjuyA06hvZnjDH@QROu2XDBfeILfLWRyZc/oAGkVrJhcuwaLsmkwzQN0XydoX "Clojure ‚Äì Try It Online")
[Answer]
# [Whitespace](https://web.archive.org/web/20150618184706/http://compsoc.dur.ac.uk/whitespace/tutorial.php), 88 bytes
```
[S S S N
_Push_0][N
S S N
_Create_Label_LOOP][S S S N
_Push_0][S N
S _Duplicate_top][T N
T   S _Read_STDIN_as_character][T   T   T   _Retrieve][S N
S _Duplicate][S S S T   N
_Push_1][T  S S T   _Subtract][N
T   S S N
_If_0_Jump_to_Label_EXIT][S S S T   T   S S S S N
_Push_48][T S S T   _Subtract][S N
T   _Swap_top_two][S S S T  S T S N
_Push_10][T S S N
_Multiply][T    S S S _Add][N
S N
N
_Jump_to_Label_LOOP][N
S S S N
_Create_Label_EXIT][S N
N
_Discard_top][T N
S T _Print_as_integer]
```
Letters `S` (space), `T` (tab), and `N` (new-line) added as highlighting only.  
`[..._some_action]` added as explanation only.
Since Whitespace inputs one character at a time, the input should contain a trailing ‚êÅ (character with codepoint 1) so it knows when to stop reading characters and the input is done.
[Try it online](https://tio.run/##K8/ILEktLkhMTv3/X0FBgYsLiEE0EHJycSpwcnKC@WAOhABxgaIgRSAhMAmkIAwwB6iZC2oIFyfQnP//dQ2NjE1MGQE) (with raw spaces, tabs and new-lines only).
**Explanation in pseudo-code:**
```
Integer result = 0
Start LOOP:
  Integer input = STDIN as character
  If(input - 1 == 0):
    Jump to Label EXIT
  input = input - 48
  result = result * 10
  result = result + input
  Go to the next iteration of LOOP
Label EXIT:
  Print result as integer to STDOUT
```
**Example run: [`input = "Hi!"`](https://tio.run/##K8/ILEktLkhMTv3/X0FBgYsLiEE0EHJycSpwcnKC@WAOhABxgaIgRSAhMAmkIAwwB6iZC2oIFyfQnP//PTIVGQE)**
```
Command     Explanation                Stack           Heap     STDIN  STDOUT  STDERR
SSSN        Push 0                     [0]
NSSN        Create Label LOOP          [0]
 SSSN       Push 0                     [0,0]
 SNS        Duplicate top (0)          [0,0,0]
 TNTS       Read STDIN as character    [0,0]           {0:72}   H
 TTT        Retrieve at address (0)    [0,72]          {0:72}
 SNS        Duplicate top (72)         [0,72,72]       {0:72}
 SSSTN      Push 1                     [0,72,72,1]     {0:72}
 TSST       Subtract top two (72-1)    [0,72,71]       {0:72}
 NTSSN      If 0: Jump to Label EXIT   [0,72]          {0:72}
 SSSTTSSSN  Push 48                    [0,72,48]       {0:72}
 TSST       Subtract top two (72-48)   [0,24]          {0:72}
 SNT        Swap top two               [24,0]          {0:72}
 SSSTSTSN   Push 10                    [24,0,10]       {0:72}
 TSSN       Multiply top two (0*10)    [24,0]          {0:72}
 TSSS       Add top two (24+0)         [24]            {0:72}
 NSNN       Jump to Label LOOP         [24]            {0:72}
 SSSN       Push 0                     [24,0]          {0:72}
 SNS        Duplicate top (0)          [24,0,0]        {0:72}
 TNTS       Read STDIN as character    [24,0]          {0:105}  i
 TTT        Retrieve at address (0)    [24,105]        {0:105}
 SNS        Duplicate top (105)        [24,105,105]    {0:105}
 SSSTN      Push 1                     [24,105,105,1]  {0:105}
 TSST       Subtract top two (105-1)   [24,105,104]    {0:105}
 NTSSN      If 0: Jump to Label EXIT   [24,105]        {0:105}
 SSSTTSSSN  Push 48                    [24,105,48]     {0:105}
 TSST       Subtract top two (106-48)  [24,57]         {0:105}
 SNT        Swap top two               [57,24]         {0:105}
 SSSTSTSN   Push 10                    [57,24,10]      {0:105}
 TSSN       Multiply top two (24*10)   [57,240]        {0:105}
 TSSS       Add top two (57+240)       [297]           {0:105}
 NSNN       Jump to Label LOOP         [297]           {0:105}
 SSSN       Push 0                     [297,0]         {0:105}
 SNS        Duplicate top (0)          [297,0,0]       {0:105}
 TNTS       Read STDIN as character    [297,0]         {0:33}   !
 TTT        Retrieve at address (0)    [297,33]        {0:33}
 SNS        Duplicate top (33)         [297,33,33]     {0:33}
 SSSTN      Push 1                     [297,33,33,1]   {0:33}
 TSST       Subtract top two (33-1)    [297,33,32]     {0:33}
 NTSSN      If 0: Jump to Label EXIT   [297,33]        {0:33}
 SSSTTSSSN  Push 48                    [297,33,48]     {0:33}
 TSST       Subtract top two (33-48)   [297,-15]       {0:33}
 SNT        Swap top two               [-15,297]       {0:33}
 SSSTSTSN   Push 10                    [-15,297,10]    {0:33}
 TSSN       Multiply top two (297*10)  [-15,2970]      {0:33}
 TSSS       Add top two (57+240)       [2955]          {0:33}
 NSNN       Jump to Label LOOP         [2955]          {0:33}
 SSSN       Push 0                     [2955,0]        {0:33}
 SNS        Duplicate top (0)          [2955,0,0]      {0:33}
 TNTS       Read STDIN as character    [2955,0]        {0:1}    ‚êÅ
 TTT        Retrieve at address (297)  [2955,1]        {0:1}
 SNS        Duplicate top (1)          [2955,1,1]      {0:1}
 SSSTN      Push 1                     [2955,1,1,1]    {0:1}
 TSST       Subtract top two (1-1)     [2955,1,0]      {0:1}
 NTSSN      If 0: Jump to Label EXIT   [2955,1]        {0:1}
NSSSN       Create Label EXIT          [2955,1]        {0:1}
 SNN        Discard top                [2955]          {0:1}
 TNST       Print as integer           []              {0:1}           2955
                                                                               error
```
The program stops with an error: no exit defined.
]