in reply to Re: Refactoring challenge.
in thread Refactoring challenge.
$str =~ s[^.{$pos1}\s*][];
removes $pos1 characters from the front of the string, plus (optionally) any whitespace that immediately follows them. Not complicated but necessary.
As for the unit tests, that would require I publish several hundred lines of support code, which would be a bit much to expect any to look through.
Otherwise, I'd be left making educated guesses. That might work, or it might not.
Fair enough. I wasn't asking for a perfect working solution, just some fresh ideas to set me on my way, which dragonchild and hv both gave me.
|
|---|