in reply to substitute space to 0
#!/usr/bin/perl # https://perlmonks.org/?node_id=1220510 use strict; use warnings; while( <DATA> ) { s/(^| \K)(?!\d)/0/g; print; } __DATA__ 1 2 2 5 4 4 4 4 4 3 4 4 1 1 5 6 4
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: substitute space to 0
by yueli711 (Sexton) on Aug 17, 2018 at 18:29 UTC | |
by tybalt89 (Monsignor) on Aug 17, 2018 at 20:02 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |