Reputation: 23660
Is there an alternative to \n
to split text onto a new line? \n
creates a new paragraph, which can inherit extra spacing. A line break method would ensure next line was same paragraph - equivalent to Shift + Enter
in Word. Does it exist as a programmatic character?
I've tagged R below, but the question seems equally valid for Python etc.
Upvotes: 0
Views: 924
Reputation: 3631
Considering the general case of flow documents, in theory line breaking is very complicated with different characters. In practice, applications or operating systems usually represent a newline with one or two control characters. For example Excel uses Left Feed or (as long as I know) word uses Vertical Tab to break. Therefore, there is no general rule in your case and it is completely application specific. In other words, you should not expect to generate a string, feed it to different environments and expect them to behave similarly.
Upvotes: 2