[Question]
  [
## Input
Your input is a list of single-digit numbers in any reasonable format, including a string of digits.
The input will not be empty.
## Output
Your output shall be the input list, but with each maximal run of nonzero digits being reversed.
## Example
Consider the input
```
95883007414830
<--->  <---->
```
where the nonzero runs have been marked with arrows.
Reversing each of these runs, we obtain the output
```
38859003841470
```
## Rules and scoring
You can write a full program or a function.
The lowest byte count wins, and standard loopholes are disallowed.
[This challenge](https://codegolf.stackexchange.com/questions/11142/reverse-each-word-in-a-line-of-text-while-keeping-the-order-of-the-words-and-ca) is related, but much more complex, since it includes additional string processing.
## Test cases
```
4 -> 4
00 -> 00
123 -> 321
0010 -> 0010
12000345 -> 21000543
18161604 -> 61618104
95883007414830 -> 38859003841470
010230456078912 -> 010320654021987
357509902003550 -> 575309902005530
2492882377675046 -> 5767732882942064
03026302053000357099 -> 03036202035000753099
```
## Leaderboard
Here's a Stack Snippet to generate a leaderboard and list of winners by language.
To make sure your answer shows up, start it with a header of the form
```
## Language, N bytes
```
You can keep old scores in the header by using the strikethrough tags: `<s>57</s>` will appear as ~~57~~.
```
/* Configuration */
var QUESTION_ID = 78510; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 32014; // This should be the user ID of the challenge author.
/* App */
var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;
function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}
function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}
function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}
function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });  
}
getAnswers();
var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(-?\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;
var OVERRIDE_REG = /^Override\s*header:\s*/i;
function getAuthorName(a) {
  return a.owner.display_name;
}
function process() {
  var valid = [];
  
  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
    });
    
    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    
  });
  
  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });
  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;
    
    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);
    var lang = a.language;
    if (! /<a/.test(lang)) lang = '<i>' + lang + '</i>';
    lang = jQuery(lang).text().toLowerCase();
    languages[lang] = languages[lang] || {lang: a.language, user: a.user, size: a.size, link: a.link, uniq: lang};
  });
  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);
  langs.sort(function (a, b) {
    if (a.uniq > b.uniq) return 1;
    if (a.uniq < b.uniq) return -1;
    return 0;
  });
  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }
}
```
```
body { text-align: left !important}
#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}
#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}
table thead {
  font-weight: bold;
}
table td {
  padding: 5px;
}
```
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/Sites/codegolf/all.css?v=617d0685f6f3">
<div id="answer-list">
  <h2>Leaderboard</h2>
  <table class="answer-list">
    <thead>
      <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>
    </thead>
    <tbody id="answers">
    </tbody>
  </table>
</div>
<div id="language-list">
  <h2>Winners by Language</h2>
  <table class="language-list">
    <thead>
      <tr><td>Language</td><td>User</td><td>Score</td></tr>
    </thead>
    <tbody id="languages">
    </tbody>
  </table>
</div>
<table style="display: none">
  <tbody id="answer-template">
    <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td><a href="{{LINK}}">{{SIZE}}</a></td></tr>
  </tbody>
</table>
<table style="display: none">
  <tbody id="language-template">
    <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td><a href="{{LINK}}">{{SIZE}}</a></td></tr>
  </tbody>
</table>
```
  
[Answer]
# Pyth, 8
```
j0_Mcz\0
```
Split on zeros, reverse and join back on zeros.
[Test Suite](http://pyth.herokuapp.com/?code=j0_Mcz%5C0&input=12300312&test_suite=1&test_suite_input=4%0A00%0A123%0A0010%0A12000345%0A18161604%0A95883007414830%0A010230456078912%0A357509902003550%0A2492882377675046%0A03026302053000357099&debug=0)
[Answer]
# [IPOS](https://github.com/DenkerAffe/IPOS), 5 bytes
```
'0!r%
```
`%` splits the input string on zeroes, applies the command `r` (reverse) to every substring and joins the result back on zeroes.
[Answer]
## [Retina](https://github.com/mbuettner/retina), 15 bytes
```
S`0
O%^$`.
¶
0
```
[Try it online!](http://retina.tryitonline.net/#code=JShHYApTYDAKTyVeJGAuCgrCtgow&input=NAowMAoxMjMKMDAxMAoxMjAwMDM0NQoxODE2MTYwNAo5NTg4MzAwNzQxNDgzMAowMTAyMzA0NTYwNzg5MTIKMzU3NTA5OTAyMDAzNTUwCjI0OTI4ODIzNzc2NzUwNDYKMDMwMjYzMDIwNTMwMDAzNTcwOTk) (Slightly modified to run all test cases at once.)
### Explanation
```
S`0
```
Split the input around `0`s that is, put each (possibly empty) run of non-zero digits on its own line.
```
O%^$`.
```
This reverses each line, by:
* Applying the stage to each line individually with `%`.
* Matching each character individually with `.`.
* Sorting it by the result of the substitution (`$`) with the empty string (the empty second line). I.e. it doesn't sort at all, since all sort values are identical.
* Then reverses the order of the sorted characters.
Finally:
```
¶
0
```
Turn the linefeeds back into `0`s.
[Answer]
# [05AB1E](http://github.com/Adriandmen/05AB1E), 6 bytes
Code:
```
0¡€R0ý
```
Explanation:
```
0¡      # Split on zeros
  €R    # For each item in the array, reverse it
    0ý  # Join by zeros
```
Uses **CP-1252** encoding. [Try it online!](http://05ab1e.tryitonline.net/#code=MMKh4oKsUjDDvQ&input=MDMwMjYzMDIwNTMwMDAzNTcwOTk).
[Answer]
# Julia, 30 bytes
```
s->replace(s,r"[^0]+",reverse)
```
This is an anonymous function that accepts a string and returns a string. To call it, assign it to a variable.
The `replace` function provides the ability to replace matches of a regular expression with the result of a function applied to each match. In this case we can get nonzeros using `[^0]+` and replace those runs with the result of the `reverse` function applied to the matched text.
[Verify all test cases online!](http://julia.tryitonline.net/#code=Zj1zLT5yZXBsYWNlKHMsciJbXjBdKyIscmV2ZXJzZSkKCmZvciBjYXNlIGluIFsoIjQiLCAiNCIpLAogICAgICAgICAgICAgKCIwMCIsICIwMCIpLAogICAgICAgICAgICAgKCIxMjMiLCAiMzIxIiksCiAgICAgICAgICAgICAoIjAwMTAiLCAiMDAxMCIpLAogICAgICAgICAgICAgKCIxMjAwMDM0NSIsICIyMTAwMDU0MyIpLAogICAgICAgICAgICAgKCIxODE2MTYwNCIsICI2MTYxODEwNCIpLAogICAgICAgICAgICAgKCI5NTg4MzAwNzQxNDgzMCIsICIzODg1OTAwMzg0MTQ3MCIpLAogICAgICAgICAgICAgKCIwMTAyMzA0NTYwNzg5MTIiLCAiMDEwMzIwNjU0MDIxOTg3IiksCiAgICAgICAgICAgICAoIjM1NzUwOTkwMjAwMzU1MCIsICI1NzUzMDk5MDIwMDU1MzAiKSwKICAgICAgICAgICAgICgiMjQ5Mjg4MjM3NzY3NTA0NiIsICI1NzY3NzMyODgyOTQyMDY0IiksCiAgICAgICAgICAgICAoIjAzMDI2MzAyMDUzMDAwMzU3MDk5IiwgIjAzMDM2MjAyMDM1MDAwNzUzMDk5IildCiAgICBwcmludGxuKGYoY2FzZVsxXSkgPT0gY2FzZVsyXSkKZW5k&input=)
[Answer]
# Retina, ~~25~~ 24
```
O^$#`[^0](?=(.*?0)*)
$#1
```
[Try it online](http://retina.tryitonline.net/#code=T14kI2BbXjBdKD89KC4qPzApKikKJCMx&input=MDMwMjYzMDIwNTMwMDAzNTcwOTk)
Saved 1 byte thanks to Martin!
Sort the nonzero digits by the number of zeros that follow the digit, in reverse order.
See [Martin's solution](https://codegolf.stackexchange.com/a/78528/31625) for a clever use of per-line mode to get a shorter program!
[Answer]
# Jolf, 8 bytes
```
RΜGi0λ_0
```
[Try it here!](http://conorobrien-foxx.github.io/Jolf/#code=Us6cR2kwzrtfMA&input=MTIzMDQ1NjAzMjQyMzQyMDEyMw)
## Explanation
```
RΜGi0λ_0
  Gi0     split input on zeroes
 Μ   λ_   map over reversal as a lambda
R      0  join by zeroes
```
The code explanation looks sort of like a lambda if you squint.
An equivalent 8-byte answer:
```
RΜGi0΅O0
```
Same thing, but it uses `΅O` (string mirror lambda) instead.
[Answer]
## Ruby, 29 bytes
```
->x{x.gsub /[^0]*/,&:reverse}
```
[Answer]
# Jelly, 5 bytes
```
ṣ0Uj0
```
[Try it online!](http://jelly.tryitonline.net/#code=4bmjMFVqMA&input=&args=WzEsOCwxLDYsMSw2LDAsNF0)
[Answer]
# Python, ~~58~~ 50 bytes
```
lambda x:"0".join([n[::-1] for n in x.split("0")])
```
Takes in a string x and splits on the zeros and reverses each element in the split and adds a zero and returns the this minus last zero.
[Answer]
# Mathematica, 30 bytes
```
Join@@Reverse/@#~SplitBy~Sign&
```
e.g. `Join@@Reverse/@#~SplitBy~Sign&[{1,2,3,0,0,5,9,0}]` = `{3, 2, 1, 0, 0, 9, 5, 0}`
[Answer]
## PowerShell v2+, 45 bytes
```
($args-split0|%{-join$_[$_.length..0]})-join0
```
Abusing the implicit casting like there's no tomorrow. Likely can't get much shorter, as there's no builtin for reverse that's shorter than this indexing trick.
### Explanation
An example of how this works -- suppose `123045` was the input `$args`. After the `-split` on `0`, the pipeline would contain an array `(123,45)`. The first loop with `|%{...}` has the current element `$_` equal to `123`, which is then implicitly cast as a string, then reversed with the `[]` indexing. That makes it `('3','2','1')` as a char-array. The loop's `-join` puts that back into a string `"321"` and leaves it on the pipeline. The next (last) loop iteration reverses the input to `"54"`. So now our pipeline is `"321"`, `"54"`. That's encapsulated in parens `()` so it's reformed into an array, and re`-join`ed back together with zeros to produce the resultant output string `"321054"`. That's left on the pipeline and output to the console is implicit.
If there are subsequent zeros in the original input, the array would be populated with null elements, so there are the correct number of zeros on the output. For example, `1230045-split0` turns into `(123,,45)` and things continue as above.
[Answer]
# Factor, 35 bytes
Beating Pyfon and Clojure, booyah!
```
[ "0"split [ reverse ] map "0"join ]
```
This anonymous function is a literal translation of [this Python answer](https://codegolf.stackexchange.com/a/78538/46231).
It's quite simple, just split the string on zeroes, reverse every element of the resulting array, and join all the elements (including zero-length strings) with `"0"`.
Here's an example of it running on all test cases:
```
IN: scratchpad auto-use {
        "4"
        "00"
        "123"
        "0010"
        "12000345"
        "18161604"
        "95883007414830"
        "010230456078912"
        "357509902003550"
        "2492882377675046"
        "03026302053000357099"
        }
        [ 
          "0" split [ reverse ] map "0" join
        ]
        map .
{
    "4"
    "00"
    "321"
    "0010"
    "21000543"
    "61618104"
    "38859003841470"
    "010320654021987"
    "575309902005530"
    "5767732882942064"
    "03036202035000753099"
}
```
`"00120"` -> `{ "" "" "12" "" }` -> `{ "" "" "21" "" }` -> `"00210"`
[Answer]
## Haskell, 45 bytes
```
r%(0:t)=r++0:[]%t
r%(h:t)=(h:r)%t
r%_=r
([]%)
```
Recursively accumulates the reversed chunk so far in `r`, prepending it when a `0` is reached. When the remaining string is empty, it also discharges `r`.
The first two repeat some code, but I didn't find a shorter way to combine them (45 and 47 bytes):
```
r%(h:t)|h<1=r++h:[]%t|1>0=(h:r)%t
r%_=r
([]%)
r%l|0:t<-l=r++0:[]%t|h:t<-l=(h:r)%t
r%_=r
([]%)
```
[Answer]
## Pyke, 8 bytes
```
\0cm_\0J
```
Explanation:
```
\0c      -   input().split("0")
   m_    -  map(reversed, ^)
     \0J - "0".join(^)
```
[Try it here!](http://pyke.catbus.co.uk/?code=%5C0cm_%5C0J&input=%2212000345%22)
[Answer]
# JavaScript (ES6), ~~50~~ 49 bytes
String version:
```
s=>s.replace(/[^0]+/g,r=>[...r].reverse().join``)
```
*Saved a byte thanks to @Kevin Lau!*
Array version (60 bytes):
```
a=>a.map((n,i)=>n?a[z-i+[...a,0].indexOf(0,i)]:(z=i,0),z=-1)
```
[Answer]
# J, ~~20~~ 18 bytes
```
0}:@;@(<@|.;.1)@,]
```
Thanks to Zgarb for helping with this! Takes a space-separated list as a right argument.
-2 bytes thanks to Zgarb!
[Answer]
# Clojure/ClojureScript, 44 chars
```
#(flatten(map reverse(partition-by pos? %)))
```
Same solution as others, just more verbose thanks to long function names. Wasn't going to post it because of that, but it beats some other answers so why not?
Works on any sequence type. In ClojureScript, this also works on strings since strings are processable as lists of characters, which are really just 1-length strings, which coerce to numbers for things like `pos?`.
[Answer]
## Haskell, 46 bytes
```
import Data.Lists
(reverse=<<).split(oneOf"0")
```
Usage example: `(reverse=<<).split(oneOf"0") $ "0123004500678090"`-> `"0321005400876090"`.
Sadly the `split` function requires the expensive import. Split the input list at every `0`, e.g. `split(oneOf"0") "0120030"` -> `["","0","12","0","","0","3","0",""]`, reverse each chunk and concatenate into a single string. 
[Answer]
# F#, 103 bytes
```
let f x=x="";x.Split '0'|>Array.map(fun s->System.String(s|>Seq.toArray|>Array.rev))|>String.concat "0"
```
[Answer]
# Java, 179 bytes(with import)
```
import java.util.*;static void r(String s){StringJoiner x= new StringJoiner("0");for(String a:s.split("0",s.length())){x.add(new StringBuilder(a).reverse());}System.out.print(x);}
```
Takes in a string input and splits the characters by zero then adds them back by calling the add method on the StringJoiner class.
[Answer]
# Oracle SQL 11.2, ~~131~~ 123 bytes
Abusing XML functions.
```
SELECT LISTAGG(REVERSE(COLUMN_VALUE||''))WITHIN GROUP(ORDER BY rownum)FROM XMLTABLE(('"'||REPLACE(:1,'0','","0","')||'"'));
```
[Answer]
# Perl, 22 bytes
Including +1 for `-p` option:
```
s/[^0]+/reverse$&/eg
```
This is a pretty trivial substitution - sorry to be so boring. Note that if your input is newline-terminated (e.g. using `perl -pe 's/[^0]+/reverse$&/eg' <<<21000543` in Bash), it will catch the newline with the digits - use `echo -n` or `printf` to avoid that. Alternatively, for a cost of one additional byte, change the character class to `[1-9]`, and you can provide many inputs, one per line.
[Answer]
## C, 105 bytes
```
#define x(o)for(p=s;*s&&'0'o*s;++s);for(r=s;r-->p;putchar(*r));
f(s,p,r)char*s,*p,*r;{x(^)x(==)*s&&f(s);}
```
Call `f` with the list of digits as a nul-terminated string, and it will print the correct output.
**Ungolfed and explained:**
```
f(s,p,r)
char*s,*p,*r; // K&R style to avoid repeating `char`
{
    // x(^)x(==) expands to...
    // Find the next zero digit
    for(p = s; *s && '0' ^ *s; ++s)
        ;
    // Print that run backwards
    for(r = s; r-- > p; putchar(*r))
        ;
    // Find the next non-zero digit
    for(p = s; *s && '0' == *s; ++s)
        ;
    // Print that run backwards (no difference, it's all zeros)
    for(r = s; r-- > p; putchar(*r))
        ;
    // If there's more string, recurse
    *s && f(s);
}
```
[See it live on Coliru](http://coliru.stacked-crooked.com/a/97f6d4a5e3fa4c17)
[Answer]
# [Husk](https://github.com/barbuz/Husk), 4 bytes
```
ṁ↔ġ¬
```
[Try it online!](https://tio.run/##yygtzv7//@HOxkdtU44sPLTm////0ZY6pjoWQGisYwCE5jomOoZADObHAgA "Husk – Try It Online") or [verify all test cases](https://tio.run/##JY27DQJBDER72YiAYPzfrQWRg9BFJwo4AiqgAXIaIEU0wjWyeCGw/caekQ/n@dSnzee5zOtlmY49ab3e3vfXo/e@K1q2BchGLD@kvwAgagMrOTmGr1mtAoSS5hxuAgvUHFEbcW7EwtAaMi9mw8PauFaWCM@T@ogJ2LNgMt5YZKLsvw)
Input is a list of digits.
`ġ`roups all adjacent runs of nonzero (`¬`=NOT) digits, then `ṁ`aps the 'reverse a list' (`↔`=REV) function across all groups, concatenating the result.
[Answer]
# [K (ngn/k)](https://bitbucket.org/ngn/k), 10 bytes
```
"0"/|'"0"\
```
[Try it online!](https://tio.run/##JY1LDgJBCETvwmY00Vh8m9aruB4XJnMC796CLigKeBXe1@N1rLXfCXT7bKXPtW@nCxk9CChh0Z/l/wBAzdsmBweam56pwDC26k0zRGEeGDlZaqM@HHOi8urejNiUTNExok4WHVNIVMG13/ioBJ3XFw "K (ngn/k) – Try It Online")
Similar to many of the other approaches; takes (implicit) input as a string of digits:
* `"0"\` split input on `0`s
* `|'` reverse each chunk
* `"0"/` join with `0`s
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 4 bytes
```
0ẆRṅ
```
Takes input as a string instead. If that's not allowed then the `Ṡ` flag can be added.
[Try it online!](https://vyxal.pythonanywhere.com/#WyJBIiwiIiwiMOG6hlLhuYUiLCIiLCJcIjRcIlxuXCIwMFwiXG5cIjEyM1wiXG5cIjAwMTBcIlxuXCIxMjAwMDM0NVwiXG5cIjE4MTYxNjA0XCJcblwiOTU4ODMwMDc0MTQ4MzBcIlxuXCIwMTAyMzA0NTYwNzg5MTJcIlxuXCIzNTc1MDk5MDIwMDM1NTBcIlxuXCIyNDkyODgyMzc3Njc1MDQ2XCJcblwiMDMwMjYzMDIwNTMwMDAzNTcwOTlcIiJd)
Explanation:
```
0     # Push the literal digit 0
 Ẇ    # Split and keep delimiter
  R   # Reverse each one
   ṅ  # Join by nothing
```
[Answer]
# Perl 5, 52 bytes
A subroutine:
```
{$_=pop;y/0/ /;map$i.=reverse,split/\b/;$i=~y/ /0/r}
```
[Answer]
## Actually, 22 bytes
```
k"a%sa"%'0@s♂R'0j#pXdX
```
This actually made me notice that there's a bug in the split command - it doesn't preserve empty splits. As a workaround, I surround the input string with `a`s before doing the split, reverse, and join, then remove the `a`s at the end. Input is taken as a string, output is a list of single-character strings.
[Try it online](http://actually.tryitonline.net/#code=ayJhJXNhIiUnMEBz4pmCUicwaiNwWGRY&input=IjAzMDI2MzAyMDUzMDAwMzU3MDk5MCI)
Explanation:
```
k"a%sa"%'0@s♂R'0j#pXdX
k"a%sa"%                surround input with "a" characters
        '0@s            split on 0
            ♂R          reverse each piece
              '0j       join on 0
                 #pXdX  listify, remove first and last element (the "a"s)
```
[Answer]
## C#, 131 bytes ##
solution flawed!
```
string j(string i){foreach(var s in i.Split('0'))if(s!="")i=i.Replace(s,new string(s.ToCharArray().Reverse().ToArray()));return i;}
```
ungolfed:
```
string j(string input)
    {
        string[] a = input.Split('0');
        foreach (string s in a)
        {
            if (s!="")
            input=input.Replace(s, new string(s.ToCharArray().Reverse().ToArray()));
        }
        return input;
    }
```
]