I have a string that I need to fill up the white space with a plus "+" sign. When I use gsub, it also puts the + sign at the beginning of the string. How can I get the + sign just in the white space of the string but not at the beginning?
Instruction: gsub(/ /, "+", $3);
Input line:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Current output:
+Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1)
Instruction: gsub(/ /, "+", $3);
Input line:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Current output:
+Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1)