> (one leading '|' in output more)

Better to rename the var >:)

s.gsub!(/./,'\&|')