[Question]
  [
Every now and again, I'll encounter a large string of alphabetical text encoded as numbers from 1-26. Before I knew that I could just google a translator online, I had to personally, painstakingly copy and paste the entirety of the encoded text into a text document and translate it myself.
Thankfully, I did know about find-and-replace features, which I used to search for all copies of each number and convert them to their corresponding characters. Only one problem... If you do this in numerical order, it will come out garbled.
This is because the single digit numbers used to encode a-i also appear as part of the remaining two digit numbers encoding j-z. For example, `26` *should* decode to `z`, but since both 2 and 6 are less than 26, we decode those first. `2` becomes `b`, and `6` becomes `f`, so `26` becomes `bf`.
Note also that for `10` and `20`, there is no conversion for `0`, so we end up with `a0` and `b0` respectively.
## Challenge
Given a string of alphabetical characters (`abcdefghijklmnopqrstuvwxyz`), output the result of converting to numbers and back again using the algorithm described above. You may assume input is all lowercase or all uppercase. This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest code in bytes wins.
Important: You may *not* zero index.
Full conversion list:
```
a: a
b: b
c: c
d: d
e: e
f: f
g: g
h: h
i: i 
j: a0
k: aa
l: ab
m: ac
n: ad
o: ae
p: af
q: ag
r: ah
s: ai
t: b0
u: ba
v: bb
w: bc
x: bd
y: be
z: bf
```
## Examples
```
xyzzy => bdbebfbfbe
caged => caged
jobat => a0aebab0
swagless => aibcagabeaiai
```
  
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 32 bytes
```
[j-s]
a$&
[t-z]
b$&
T`j-z`0a-i0l
```
[Try it online!](https://tio.run/##K0otycxL/P8/Oku3OJYrUUWNK7pEtyqWKwnICknI0q1KMEjUzTTI@f@/orKqqpIrOTE9NYUrKz8psYSruDwxPSe1uBgA "Retina 0.8.2 – Try It Online") Link includes test cases. Explanation:
```
[j-s]
a$&
[t-z]
b$&
```
Precede the letters `j-z` with an `a` or `b` as appropriate.
```
T`j-z`0a-i0l
```
Translate them to `0` or `a-i` as appropriate. (`l` expands to `a-z` but only `a-f` get used as the replacement list gets truncated to the length of the translation list.)
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 8 bytes
```
øAṅ₄ɾkaĿ
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLDuEHhuYXigoTJvmthxL8iLCIiLCJqb2JhdCJd)
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 70 bytes
```
s=>s.replace(r=/./g,c=>parseInt(c,36)-9).replace(r,i=>'0abcdefghi'[i])
```
[Try it online!](https://tio.run/##XcxBCoMwFATQfU8h3ZiAGqFQ6CLue4bSxf/JTxoJRhJpq5dPtRvBmdXAY3p4Q1LRjVM9BE3ZyJxkl5pIowdFLErRCFsp2Y0QE92HianqcuX1je@mcrIrW0ClydiXKx/uybMKQwqeGh8sM@z8nZdlPnNerBGiQI2EZi2dDlCBJb3D/zyaPiBMu4EWCAHbI0sfsJ5S2uTGHK5vgAQOXP4B "JavaScript (Node.js) – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~10~~ 8 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
A0ìDIkSè
```
I/O as lowercase list of characters.
-2 bytes thanks to *@CommandMaster*
[Try it online](https://tio.run/##DcM7EkAwAEDBu6RWuIIZjVppFD5BBEH8T6Rwixws3s6ssUWppPdR6L440al7vc9EIQJRsmJNyYYtOyr21Bw4cqLhzIUrLTfuPHjy4s1H5D8) or [verify all test cases](https://tio.run/##yy9OTMpM/e94aFVZpb2SwqO2SQpK9pXBh1b@dzQ4vMbl0Lrs4MMr/nvp/I9WqqisqqpU0lFKTkxPTQHSWflJiSVAurg8MT0ntbhYKRYA).
**Explanation:**
```
A         # Push the lowercase alphabet
 0ì       # Prepend a leading "0"
   D      # Duplicate it
    I     # Push the input character-list
     k    # Get the (0-based) index of each character in the "0abc...xyz" string
      S   # Convert it to a flattened list of digits
       è  # (0-based) index each into the "0abc...xyz" string
          # (after which the result is output implicitly)
```
If `None` is a valid output for `0`, builtin `.b` could be used for an alternative 8-byter in the legacy version of 05AB1E, with uppercase character-lists as I/O: [try it online](https://tio.run/##DcO7DkAwAEDRf@kswmCV1Lve1FsMmpjMvr/uSY4X3MZ/rJWfekPtGmtPIYUjIsZMmDJjzoKKJSvWbNiyY8@BIzUnzly4cuPOQ1w/). (The `.b` results in `"@"` in the new version of 05AB1E for `0`: [try it online](https://tio.run/##DcM5CoAwAADBv6QWnyDEO94ab7EwYCEWFuL74w7M8x7mOq2Vn7o97RprNyGFI3wGDBkxZsKUihlzFixZsWbDlh01ew4cOXHmwlXsPw).)
[Answer]
# [><>](https://esolangs.org/wiki/Fish), 35 bytes
```
i"`":@-:9)?\+o
"*-$a,"`"+o\:a%:0="0
```
[Try it online](https://tio.run/##S8sszvj/P1MpQcnKQdfKUtM@RjufS0lLVyVRByimnR9jlahqZWCrZPD/f1Z@UmJJBQA)
**Explanation**
```
i"`":@-               # get input and subtract 96 from it to convert letters to 
                        1-indexed numbers and save a copy of 96 for reverse 
                        conversion later
       :9)?\+o        # if number is > 9 move down, else print with saved 96 added
           \:a%       # mod a copy of the number by 10
"*-            :0="0  # if the result is 0, subtract 48
   $a,"`"+o           # divide the other copy by 10 and print with 96 added
           \          # handle the print of the mod copy on the first row
```
[Answer]
# [C (clang)](http://clang.llvm.org/), ~~74~~ 67 bytes
* -6 bytes thanks to [@jdt](https://codegolf.stackexchange.com/users/41374/jdt).
```
p(c){c&&putchar(c^96);}c;f(*s){for(;c=*s++%96;p(c%10?:80))p(c/10);}
```
[Try it online!](https://tio.run/##bY/vaoMwEMA/16c4BEuiLbNQymome4G9wdrBJUaX4aIYu9qKrz53tbQfynIf8rs//LhTS1WiLcaxZor3aj6vD636xIapj@2Gi0GJnIWO93nVMKHS0EVRsN0Img5W8WvyHHNO/LSKaXY0tvW@0Vj2U5mMe703U5V1LVAdwhu@r/cp9PDmd6fz@eQviBQWOpvoq5LYTuSOWJTaOR8G8Y9Hd3ePzKSWOYV@kGGMWqKMr4mR1EGp0aC5SukmYBengRRiQd8LrAVEkeFAu8/qhpo584PS7azuaq1anSUwpQCNdoeyTYDsdJTZLy47mT0n8SxnU4kYHt7NubM7619mB28Yf1VeYuHG5fEP "C (clang) – Try It Online")
[Answer]
# [lin](https://github.com/molarmanful/lin), 41 bytes
```
$a0`,.+10`t2`/\"`rev `_`"`' , `,*10`d tro
```
[Try it here!](https://replit.com/@molarmanful/try-lin)
Decided to go for a different non-regex approach, which came out quite nicely. Turns out that `tro` surprisingly accepts an iterator of iterators, which saved quite a few bytes.
For testing purposes:
```
"jobat" ; outln
$a0`,.+10`t2`/\"`rev `_`"`' , `,*10`d tro
```
## Explanation
Prettified code:
```
$a 0`, dup 10`t 2`/\ ( `rev `_` ) `' , `,* 10`d tro
```
* `$a 0`,` alphabet with 0 in front as *a*
* `$a 0`,.+ 10`t` duplicate and create `0abcdefghi`
* `2`/\ ( `rev `_` ) `'` 2-digit pairs (`00 0a 0b ... ig ih ii`)
* `, `,* 10`d` zip with *a* and remove first 10 pairs (`[j a0] [k aa] [l ab] ... [x bd] [y be] [z bf]`)
* `tro` transliterate
[Answer]
# [Husk](https://github.com/barbuz/Husk), 14 bytes
```
m!₁ṁod€₁
…"az0
```
[Try it online!](https://tio.run/##yygtzv7/P1fxUVPjw52N@SmPmtYAmVyPGpYpJVYZ/P//PzEpOSU1LT0jMys7Jzcvv6CwqLiktKy8orIKAA "Husk – Try It Online")
Inspired by [Kevin Cruijssen's approach](https://codegolf.stackexchange.com/a/250182/95126), although comes-out a bit longer in [Husk](https://github.com/barbuz/Husk)...
```
…               # Fill-in the gaps with character ranges
 "az0           # in the string "az0"
                # (fill-in works both backwards & forwards, resulting in:
                # "abcde...vwxyzyxwv...edcba`_^]\...43210")
                # = assign this as '₁'
   ṁo           # Now, for each input letter
      €₁        # get the index of first occurence in ₁ (=index in alphabet)
     d          # and split the decimal digits;
m               # Then, for each digit
 !₁             # retrieve the element in ₁ using modular 1-based indexing
                # (so zero retrieves the last element)
```
[Answer]
# [R](https://www.r-project.org), 75 bytes
```
\(s,`[`=gsub)chartr("j-z","0a-i0a-i","([j-s])"["a\\1","([t-z])"["b\\1",s]])
```
[Attempt This Online!](https://ato.pxeger.com/run?1=NY1RCoMwDIbfdwrJXlqw4N724i6wI6hgoq2rDAamstmr7MUNdqjdZrU6QsjP95Hk-Rrmt8k_ozPq-D2XgtO6qPOOR5LNBQc3COiVhxQyVHbpEEXRK64kFIBleYjAKR8BRcBVJbeTxgh4TN5PIPdJfkqoJU0mlN4F02Cn283EvMD-Rug2iBlqQsoWznfsrpr5ryyFFSSNFu36bZ7X-QM)
Straightforward replacement.
---
### [R](https://www.r-project.org), ~~84~~ 81 bytes
*Edit: -3 bytes thanks to [@Dominic van Essen](https://codegolf.stackexchange.com/users/95126/dominic-van-essen).*
```
\(s)gsub("`",0,intToUtf8(strtoi(unlist(strsplit(paste(utf8ToInt(s)-96),"")))+96))
```
[Attempt This Online!](https://ato.pxeger.com/run?1=NY0xDoJAEEV7T0HWZidCQmWw0N7SBDsLZ2SXrCFAmCEKV7FBEw_lbVwEM8X8-S__z-PZDC-7fbdio-RzOGmGnFvS6qzCOHSlpNVRbKJZGqmcbsvCsYwX14UTXSOL0T6cpNW-9ACizRpCpQBg5RXMxdZqde_6vlOwDLa7gDIyZP2YhScXzE02k58ezWtFKLOJMRpCikefb5gXhvmPHPkIkkGHbvo2DNP-Ag)
Going with the algorithm.
[Answer]
# [Perl 5](https://www.perl.org/), 27 bytes
```
s/./-96+ord$&/ge;y/1-9/a-i/
```
[Try it online!](https://tio.run/##K0gtyjH9/79YX09f19JMO78oRUVNPz3VulLfUNdSP1E3U////4rKqqpKruTE9NQUrqz8pMQSruLyxPSc1OLif/kFJZn5ecX/dQsA "Perl 5 – Try It Online")
[Answer]
# [Lexurgy](https://www.lexurgy.com/sc), 92 bytes
```
a:
{j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}=>{a\0,aa,ab,ac,ad,ae,af,ag,ah,ai,b\0,ba,bb,bc,bd,be,bf}
```
Naive 1-1 substitution.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 13 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
;£ÒCaXÃ®°gCi0
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=O6PSQ2FYw66wZ0NpMA&input=WwoieHl6enkiCiJjYWdlZCIKImpvYmF0Igoic3dhZ2xlc3MiCl0tbVI)
```
;£ÒCaXÃ®°gCi0
;             # C = "abcdefghijklmnopqrstuvwxyz"
 £            # For each letter in the input:
   CaX        #  Find its 0-based index in C
  Ò           #  Add 1
      Ã       #  Join to a string
       ®      # For each character in the new string
        °     #  Coerce to a number
         g    #  Get the character at that index in:
          Ci0 #   C with a 0 added to the front
```
[Answer]
# [Piet](https://www.dangermouse.net/esoteric/piet.html) + [ascii-piet](https://github.com/dloscutoff/ascii-piet), 129 bytes (5×27=135 codels)
```
uqijsvudnbddt   feussskiu L?q   sa   dttlvqfeumdctss?Lr????saa???????????????s  Lkjftrqavqcefcnbftmnkss K                    ssvc
```
[![Code](https://i.stack.imgur.com/egOw9.png)](https://i.stack.imgur.com/egOw9.png)
[Try Piet online!](https://piet.bubbler.one/#eJydT02LwkAM_S85v8KkdVqnJ-sHggh76IIf1YNoBUGrUD3J_vdNxo7snhZ25sFMkpeXlyftr4ea8qqy6IEN-kjAsOAYGbinr8CAXYDUMyEk_jrtsZpPt6i4ryKBKcT0R5-qGEhGOZ0Isx9gpaBq0q8ysX7eeMmkv3J_IummqpyTpWSgQayTOwNWDagN2-2pBLGTwb2sOLydO13N4d_wen5k0NuC2vpGOUVRRKDz6SJ_Nv5IXLd7yo-7c1uDTs3tcZfqcrVerwabRjo2zaiYTsYhmH0Mi88QlItiOp-U5YC-vgFlgGcR)
Input the string in upper-case with the [sentinel value](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods/24639#24639) `@`.
**Explanation**
[![Step 1](https://i.stack.imgur.com/kd10h.png)](https://i.stack.imgur.com/kd10h.png)
Read char from input, subtract 64 and check if it is greater than 9.
[![Step 2](https://i.stack.imgur.com/PgCsN.png)](https://i.stack.imgur.com/PgCsN.png)
If c<=9: check if its check if it is greater than 0 (else terminate).
[![Step 3](https://i.stack.imgur.com/Gd65X.png)](https://i.stack.imgur.com/Gd65X.png)
Add 64, print char and start over.
[![Step 4](https://i.stack.imgur.com/hGWew.png)](https://i.stack.imgur.com/hGWew.png)
If c>9: duplicate, push 10 on stack, duplicate, roll, divide, print char, modulo and check if it is greater than 0.
If c>0: print char (as above) and start over.
If c=0: print number and start over.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 13 bytes
```
⭆⭆Ｓ⊕⌕βι§⁺β0⊖ι
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRCO4BEil@yYWILE88wpKSyBcDU0dBc@85KLU3NS8ktQUDbfMvBSNJB2FTE1NoIxjiWdeSmqFRkBOaTFIVMlACSjqkopQD1KnqWn9/39WaXHJf92yHAA "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
  Ｓ             Input string
 ⭆              Map over characters and join
    ⌕           Index of
      ι         Current character
     β          In lowercase alphabet
   ⊕            Incremented
⭆               Map over characters and join
         β      Lowercase alphabet
        ⁺       Concatenated with
          0     Literal string `0`
       §        Indexed by
            ι   Current character
           ⊖    Decremented (auto-casts to integer)
```
[Answer]
# [Factor](https://factorcode.org/), 53 bytes
```
[ 96 v-n [ >dec ] map-concat 48 v+n "`" "0" replace ]
```
Needs modern Factor for [>dec](https://docs.factorcode.org/content/word-__gt__dec,math.parser.html) but here's a version that works on TIO for +1 byte:
[Try it online!](https://tio.run/##Rc29CsIwFIbhvVfxkVVaHET8uQBxcRGnIniMx1qpaZqc/orXHuPk@vLAeycttQun4/6w2@BF8sg6/iUPz03LRrPPeBBHMdiqFClNgaaHdSwyWlca@Utsk6Tp3xjGaRqhqeAbnvWVIumpqNh7fEKO9RJdapCjNZacZ5zj2aa6NjrSxQrdzEBdlJorx7YiHUWIAln4Ag "Factor – Try It Online")
[Answer]
# JavaScript (ES6), 71 bytes
```
s=>s.replace(/[j-z]/g,c=>"ab"[c>'s'|0]+"abcdefghi0"[parseInt(c,36)%10])
```
[Try it online!](https://tio.run/##XczBCoMwEATQe79CAkWlalIKvem93yAeduOaRsSIK22V/nuqvQjOnAYe08ILWI92mNLe1eSb3HNecDbS0IGmSJZtulTSJDovBKAodRFy@FXVZV26psY8rRLlACPTo58indzu8fmqqthr17PrKOuciZpIfOZlmUUcB2ukDLBGwmYtnQ5Qg6F6h/95NK1DmHYDCggB1ZHxG0xHzJvcmMX1DZDAgvU/ "JavaScript (Node.js) – Try It Online")
[Answer]
# [Burlesque](https://github.com/FMNSSun/Burlesque), 25 bytes
```
)**96?-imXX@azr@'0+]jsi\[
```
[Try it online!](https://tio.run/##SyotykktLixN/V@tpGBrp6Bkba0b@19TS8vSzF43MzciwiGxqshB3UA7Nqs4Myb6f214zv@KyqqqSpDipJSk1KQ0IEzlSk5MT00BiYEZXFn5SYklIG6iQWJqUmKSAVdxeWI60KZisGBmElBZYlJqYmZiJgA "Burlesque – Try It Online")
```
)**   # Map ord(a)
96?-  # Subtract 96 (get index into alphabet)
imXX  # Concat and separate by digit
@azr@ # Alphabet [a,b,..,z]
'0+]  # Prepend [0,a,b,..,z]
jsi   # Select indices
\[    # Concat
```
[Answer]
# [Python 3](https://docs.python.org/3/), 79 bytes
```
lambda s:s.translate({n:'AB'[n>83]+'0ABCDEFGHI'[n%74%10]for n in range(74,91)})
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUaHYqlivpCgxrzgnsSRVozrPSt3RST06z87COFZb3cDRydnF1c3dwxMopGpuompoEJuWX6SQp5CZpwDUlJ6qYW6iY2moWav5v6AoM69EI01DPSIyKipSXVOTCy7i7Oju6oIi4uXv5BiCIhIc7uju4xocjKrM0dkbKPAfAA "Python 3 – Try It Online")
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 74 47 bytes
```
sed "s/[j-s]/a&/g;s/[t-z]/b&/g"|tr j-z 0a-i0a-i
```
[Try it online!](https://tio.run/##HY3LCoMwEEX3fsVFRHQRYruVLvoHBZfiYkbji4LQCbSm@u1pGoYZOIc7XCaZ/ViUXy9mQCq6XZV0mnI91QGscp3mAOlhX1iVQ0Vq@a8/Eys2PKJFdsUNWWH6eUN2wYGxRIc8RzSPe9PUOJN/Hp/duR08sOExjImypymUxxt53ZgsqCLDxFVU8qbpaURAC4cgsaGFFv8D "Bash – Try It Online")
*-27 thanks to [Neil's idea](https://codegolf.stackexchange.com/a/250156/15469)*
# first approach, 74 bytes
```
sed "s/./\"'&\"/g"|xargs printf '%d-96\n'|bc|sed '/../s/./&\n/'|tr 1-9 a-j
```
[Try it online!](https://tio.run/##HcvBCoMwEATQe75iidScNPZS8NB@SS67GtNI0ZINVCX/nkaZy/CYIeR3zmxHkKxbbaSqjdROpg2DY/gGv8QJ1G1s@odZVKIhnWOl21afh9osWqUY4N70gM2cK9j249jh@QIaydJUYkUFA7ryK3qVAvNKGE/ADi0hdcX4h@5jmS/2VKZIFj36PItVkEAR/w "Bash – Try It Online")
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 16 bytes
```
sm@+G0tsdjkmhxGd
```
[Try it online!](https://tio.run/##K6gsyfj/vzjXQdvdoKQ4JSs7N6PCPeX/f6WKyqqqSiUA "Pyth – Try It Online")
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), 76 bytes
```
f=lambda s:s and'ba'[2-(q:=ord(s[0])%32)//10::2]+'0abcdefghi'[q%10]+f(s[1:])
```
[Try it online!](https://tio.run/##DcoxDoMgFADQvadgMUC1EXRoS@JJCMNHQG0UFExavTx1estbj30Mvn2tMWfXzbBoAyiJhMAbrAHL5kE20YVoSJJM0aJtaF1zJkSjSsxA98a6YZyw3ArOVOmuxoWi2YWIPJo8kvcFVtKPsYrgB0vez4o3LaUV/h3neeAK9zBYc/kJGvbL9IVhtilhJW4IrXHyO3HEU5r/ "Python 3.8 (pre-release) – Try It Online")
[Answer]
# [R](https://www.r-project.org), 68 bytes
```
\(x,y=utf8ToInt(x)-96)intToUtf8(rbind(y/10+96*(y>9),48--y%%10%%-58))
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72waMG6nNSSEqO80lwjEMN2aWlJmq7FTZcYjQqdSlsgxyIk3zOvRKNCU9fSTDMzryQkPxQoqFGUlJmXolGpb2igbWmmpVFpZ6mpY2Khq1upqmpooKqqa2qhqQk1ayaKDRpKFZVVVZVKmgrKCrZ2CkkpSalJaUCYyoWmLDkxPTVFSROsCsxGV5CVn5RYAjMn0SAxNSkxyQBdUXF5YnpOanExXF1mEtCwxKTUxMzETIgDFyyA0AA)
Calculates 2 decimal digits for each letter, and then calculates the corresponding codepoint values, setting unused values (leading zeros) to zero, which is not output by the `intToUtf8` function.
---
# [R](https://www.r-project.org), 54 bytes
```
\(x)chartr('1-9','a-i',Reduce(paste0,utf8ToInt(x)-96))
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72waMG6nNSSEqO80lwjEMN2aWlJmq7FTbMYjQrN5IzEopIiDXVDXUt1HfVE3Ux1naDUlNLkVI2CxOKSVAMdoFqLkHzPvBKgYl1LM01NqO6ZKGZqKFVUVlVVKmkqKCvY2ikkpSSlJqUBYSoXmrLkxPTUFCVNsCowG11BVn5SYgnMnESDxNSkxCQDdEXF5YnpOanFxXB1mUlAwxKTUhMzEzMhDlywAEIDAA)
Port of [Kjetil S's Perl answer](https://codegolf.stackexchange.com/a/250198/95126).
[Answer]
# [C (GCC)](https://gcc.gnu.org), ~~101~~ ~~88~~ 87 bytes
```
f(char*s){for(char*x;*s;)for(asprintf(&x,"%d",*s++-64);*x;)putchar(*x+(*x++^48?16:0));}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=TVDtasIwFP3dPkWIKE1bR4VO3GI3Eo3iGBPWiVPnRPoxA1srNoWC-CT74x8fyhfYcyyxZYzccG5yzzm5N9-nYPURBMdzoxZGMU8isBo-TVb-ePLcY3qNJ8FnHkagm4mQp1ebu1Mu4mbnPI2NYLPemRnax-muzAtsZhip4zrb7ngiYqNR2LAeQtvMLKvZdhGWJLTNheIbZmGpbb27nftW-9ZBCB8q-x-pBl9rnhgI7HVN0QFPFu5ycbP09vB1Np_PoA17ZMj6Eh_GlLxI9Kdk-Mh8Hx5wJYoKJWpdKxXtU0YHcrF_UuIQRgl1VDqi8pZQRkZkdLFQs6hOuOdgwLsutiyOZD8XbxMIT_bEl5KoxYZA-K-QevLdslB9BAT1TMZbAm1hpwhrunbQq2mPxxJ_AQ)
Prints to standard out. Uses `asprintf`, which is a GNU-specific function and may or may not require a definition in the header, so I don't know if it's okay.
This is basically the first C function I've ever written, so there are almost certainly ways this can be improved.
---
-13 bytes from @c-- by iterating one character at a time, removing parens, and changing the ternary  
-1 bytes from @ceilingcat by moving the `char*x` declaration into the for statement
[Answer]
# [Dyalog APL](https://www.dyalog.com/products.htm), 32 bytes
```
{(⎕A,'0')[27@(0∘=)⍎¨∊⍕¨⎕A⍳⍥⎕C⍵]}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m70qpTIxJz89PrEgZ8GCpaUlaboWNxMe9U191DahWgNIO-qoG6hrRhuZO2gYPOqYYav5qLfv0IpHHV2PeqcCaaCCR72bH_UuBbKcH_Vuja09tEK9orKqqlJdQT05MT01BUhn5ScllgDp4vLE9JzU4mJ1iD1Q62DWAgA)
```
                       ⎕A⍳   ⍵  find each character's index in the alphabet
                          ⍥⎕C   case insensitively (casefold both arguments first)
                     ⍕¨         turn each number into string
                    ∊           flatten nested array to get the individual digits
                  ⍎¨            turn each digit back into a number
          27@(0∘=)              turn 0s into 27s
         [                    ] index into
  ⎕A                            the alphabet
    ,'0'                        with a 0 at the end at the 27th position
```
[Answer]
# [J-uby](https://github.com/cyoce/J-uby), 43 bytes
```
~(:gsub+(:ord|:+&-96))&/./|~:tr&"a-i"&"1-9"
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m700K740qXLBIjfbpaUlaboWN7XrNKzSi0uTtDWs8otSaqy01XQtzTQ11fT19GvqrEqK1JQSdTOV1JQMdS2VoFqcCkpLihXcopUqKquqKpViuWD85MT01BQkflZ-UmIJEr-4PDE9J7W4WCkWYtKCBRAaAA)
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 12 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
c_uH sAÇ©d96
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=Y191SCBzQcepZDk2&input=WwoieHl6enkiCiJjYWdlZCIKImpvYmF0Igoic3dhZ2xlc3MiCl0tbVI) (Includes all test cases)
```
c_uH sAÇ©d96     :Implicit input of string
c_               :Map codepoints
  u              :  Modulo
   H             :    32
     s           :  Convert to string in base
      A          :    10
       Ç         :    Map the range [0,A)
        ©        :      Logical AND with
         d96     :      Add 96 and get character at that codepoint
```
[Answer]
# [Julia 1.7](https://julialang.org), 52 bytes
```
!x=replace(join([x...].-'`'),('1':'9'.=>'a':'i')...)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=XZBBasMwEEXX9Skm2kgCx6TQRRNQVj1CdsakI2ts5ArbWAqxc5VussmhcpvKtbsps5jP-_wPM9-P5uIs3u-PS6i278-3zagG6h2WJJrOtiIfsywrsi3_5DIV_JUf-J5n6sgxKstldOWafRr1Ycsgkhc2TrfbxEAdgWmjSVdxiKXRKbEmsziLnGHTaQwLxB2SRr375f6KtSPvV8vqGEFNaNGyRCYJOncO5IM_9-g9GVAQkcg3XzSBUmDyKAqougFmYtt5eWFkIZN-sG1wrWCnuQDmAtvWB2Ap_K9dD_x70g8)
* `replace` supports multiple patterns as of Julia 1.7
# [Julia 1.0](http://julialang.org/), ~~66~~ 65 bytes
```
~x=join(get.([Dict('1':'9'.=>'a':'i')],[join([x...].-'`')...],0))
```
[Try it online!](https://tio.run/##XYzBjsIgEIbP8hSEC5B0ST3uJnjyLUijg4zNVNIawWzrwVevtN3TZg7z5fvnn@4ZCfbjPL9H2w3UqxazUe5Il6zkXv7Ib2nsQUIhkrqp3HrkRmNMY77kWeqFqlrrOdi1xXZinF6vSXB74MIHj/5aBkVVkgu0GLZkw0V2g4e8SagBPfh69ekX2ogp/UXkSwU8AgEJphmDGE8ZU06nO6SEgVtelHLvG07cWh5cgYZfhwdfDPXLSiroRrP7g/oce/X/h54/ "Julia 1.0 – Try It Online")
* -1 byte thanks to MarcMush: replace `(Dict(_),)` with `[Dict(_)]` for [accessing multiple dictionary values](https://discourse.julialang.org/t/how-can-i-access-multiple-values-of-a-dictionary-using-a-tuple-of-keys/56868).
[Answer]
# [Knight](https://github.com/knight-lang/knight-lang) (v2), ~~49~~ 46 bytes
```
;=y,=xP;Wx;=y+y-Ax 96=x]x;W=y]y=x+x&[yA+96[yOx
```
[Try it online!](https://knight-lang.netlify.app/#WyI7PXksPXhQO1d4Oz15K3ktQXggOTY9eF14O1c9eV15PXgreCZbeUErOTZbeU94Iiwiam9iYXQiLCIyLjAiXQ==)
This uses the quirky nature of `+(List, Number)`. It acts similarly to appending to a String where it will append individual digits, with the exception that the elements will be Number instead of String.
So for example, `+ @ 42` will result in `[4, 2]`, compared to `+ "" 42` which will be `"42"` or `+ @ "42"` which will be `["4", "2"]`.
This has a bunch of perks:
* Creating a list is only one char (`@` for empty, `,` with an existing expression), compared to empty string which is 2 (`""`)
* The digits will be a Number, so there is no need to convert from ASCII to do char math. I can therefore use the `&` operator to both test if the digit is 0 without a compare, and append that `0` if it is due to coercion rules.
```
; = y ,                             # Set y to a list with one dummy argument (which is x)
        : = x PROMPT()              # Read a string into x
# Convert to a list of numbers containing each digit (with a preceeding dummy value)
; WHILE (x)                         # While x is not empty
    ; = y + y (- ASCII (x) 96)      # Push DIGITS of x[0] - 'a' - 1 as Number to y
    : = x ] x                       # Pop front char from x
# Convert back
# x = "", y = [ dummy, digit, digit ]
; WHILE (= y ] y)                   # While y is not empty, popping front beforehand
    : = x + x (                     # Append to x...
       & [ y                        #   Either y[0] if it is zero (which is coerced to '0')
       : ASCII (+ 96 ([ y))         #   or y[0] + 'a' - 1 converted to ASCII
    : )
: OUTPUT x                          # Output the string in x
```
* -3 bytes for taking Samp's advice and making `y` for `WHILE(= y ] y)`
[Answer]
# [J](http://jsoftware.com/), 34 32 bytes
```
"."0@(,&":/)&.:(('0',97}.a.)&i.)
```
[Try it online!](https://tio.run/##HYxNC4JAGITv@yte97AfoOvWoXBDEYJOnbpLvKurKYEHjdLot28qw8DMwzCdTwKzKw6BSTgnVPEaUgMcQtBgFkcKzrfrxVNFdS5CRk0smTJCcM3D5PhTqCRrlfSSuPLRg9iDFpGBWrIszs23fI3ypO57KNZDTT7TPE@QZmAr62y9yJESG1etbAuk6y2Oa0WNzqLVZHhj83TDsMHWLjO0DltsifR/ "J – Try It Online")
[Answer]
# Batch, 432 Bytes
```
SETLOCAL ENABLEDELAYEDEXPANSION&(CMD /U /C^"<NUL SET /P=abcdefghijklmnopqrstuvwxyz^"|FIND /V ""|FINDSTR /N "^")>a&(CMD /U /C^"<NUL SET /P=%s%^"|FIND /V "")>t&FOR /F %%Q in (t)DO (FOR /F "tokens=1-2 delims=:" %%A in ('FINDSTR /RC:"%%Q" a')DO (IF %%A GEQ 20 (SET /Ad=%%A+76&CMD /CEXIT !d:96=48!&<NUL SET /P=b!=exitcodeAscii!) else IF %%A GEQ 10 (SET /Ad=%%A+86&CMD /CEXIT !d:96=48!&<NUL SET /P=a!=exitcodeAscii!) else <NUL SET /P=%%B))
```
Assuming @ECHO OFF and passing it as
```
CALL golf.bat swagless
```
produces
```
aibcagabeaiai
```
This can probably not the best way, but I thought that this was a pretty cool way to do it. Ungolfed:
```
(CMD /U /C^"<NUL SET /P=abcdefghijklmnopqrstuvwxyz^"|FIND /V ""|FINDSTR /N "^")>a
(CMD /U /C^"<NUL SET /P=%1^"|FIND /V "")>t
FOR /F %%Q in (t) DO (
    FOR /F "tokens=1-2 delims=:" %%A in ('FINDSTR /RC:"%%Q" a') DO (
        IF %%A GEQ 20 (
            SET /Ad=%%A+76
            CMD /CEXIT !d:96=48!
            <NUL SET /P=b!=exitcodeAscii!
        ) else IF %%A GEQ 10 (
            SET /Ad=%%A+86
            CMD /CEXIT !d:96=48!
            <NUL SET /P=a!=exitcodeAscii!
        ) else <NUL SET /P=%%B
    )
)
```
]