Suppose you run the following piece of vimscript:
let @z = system("date")
This will put a string version of the current date into the z register, but the string will end with a newline that I don’t want. Is there a built-in way (similar to Perl’s chomp
) to get rid of a string’s trailing newlines?