Catering for multiline input and assuming backspaces at beginning of lines should simply be removed:
$s = "\b\bthis is an\b correct\b\b\b usage\b\n\b2nd\n\b\b3rd\n"; $s =~ s/^[\b]+//mg; 1 while $s =~ s/[^\b][\b]//g;
/-\
In reply to Re: Re: Re: Re: should this backspace removal code be done better?
by eyepopslikeamosquito
in thread should this backspace removal code be done better?
by smackdab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |