print("\"text\" \"text\" \"text\" text text text text text text text text text\ntext text text text text text text")
Allow:
print("
\"text\" \"text\" \"text\" text text text text \
text text text text text\n
text text text text text text text
")
// shorter alternative:
print("\"text\" \"text\" \"text\" text text text text \
text text text text text\n
text text text text text text text")
Extend to:
print("""
"text" "text" "text" text text text text \
text text text text text
text text text text text text text
""")
// shorter alternative:
print(""""text" "text" "text" text text text text \
text text text text text
text text text text text text text""")
Ban the following forms:
// #1
"
abc
def"
// #2
"abc
def
"
// #3
"""
abc
def"""
// #4
"""abc
def
"""
Trailing \
provides two functionalities:
- Hard wrapping a long line.
- Boundary for trailing whitespace characters.
(If no trailing whitespace character are presented, then we can ommit the \
)
// #1
"
a\
b\
" == "ab"
// #1.1
"
a
b
" == "ab"
// #2
"
a \
b \
" == "a b "
// #3
"
c \
d \
" == " c d "
// #3.1
" c \
d " == " c d "
// #3.2
" c \
d " == " c d "
// #4
"""
a \
b
c\
""" == "a b\nc"
// #4.1
"""
a \
b
c
""" == "a b\nc"
// #5
"""
a \
b
c
""" == " a b\n c"
// #5.1
""" a \
b
c""" == " a b\n c"