Yes, you can use a literal string that does not include the newline, so that the newline shows only for your code.
Use \
to escape the newline, so that it is not included in the string:
(setq foo "hello \
world")
C-h v foo
"hello world"
One place where this is often used is in a doc string, where the literal string uses \\<...>
or \\[...]
constructs that make the doc string look long in the source code. When rendered as part of the help output the result might show a short key sequence, so you use \
to chop the literal string in the code but keep it all on one line in the help output.
For example, this doc-string sentence is all on one line, which appears as You can use this command only from the minibuffer (‘C-%’).
in the help output. But in the source code does not appear as a single, long line - there is a newline after the \
.
"...
You can use this command only from the minibuffer (`\\<minibuffer-local-completion-map>\
\\[icicle-candidate-set-swap]')."