Thomas Morley <thomasmorle...@gmail.com> writes: > Hi all, > > consider the following string: "bar\"foo\"buzz" > I want to display it like: bar\"foo\"buzz
What for? The answer depends on your reason. It would be possible to just format it in print syntax and hack off the first and last character. However, formatting in print syntax entails more changes than just " -> \" and this may either be _exactly_ what you actually want, or not at all. > I can make it work with: > (display (string-join (string-split strg #\" ) "\\\"")) > ->bar\"foo\"buzz > > Is there any better way? Well, if you are just out for ", you can use (regexp-substitute/global (current-output-port) "\"" "wawawa\"wawa\"" 'pre "\\\"" 'post) Use #f instead of (current-output-port) if you don't want to output to a port but have a string returned. The regexp routines from Guile are pretty awkward to use. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user