Say I have the following (where <space>
indicates an actual whitespace character)
Line 1
Line 2<space>
Line 3
Line 4<space>
Line 5
and I wanted it to be
Line 1/
Line 2/
Line 3/
Line 4/
Line 5/
I initially thought that maybe s/\s*$/\//g
would work but then I ended up with the following as the solution
Line 1/
Line 2//
Line 3/
Line 4//
Line 5/
I can't think of a way to include the case where there is a whitespace character at the end that I want replaced.