Skip to content

Files

Latest commit

 

History

History
36 lines (25 loc) · 583 Bytes

TrimMultilineRawString.md

File metadata and controls

36 lines (25 loc) · 583 Bytes

Pattern: Untrimmed multi-line raw string

Issue: -

Description

All the Raw strings that have more than one line should be followed by trimMargin() or trimIndent().

Example of incorrect code:

"""
  Hello World!
  How are you?
"""

Example of correct code:

"""
  |  Hello World!
  |  How are you?
""".trimMargin()

"""
  Hello World!
  How are you?
""".trimIndent()

"""Hello World! How are you?"""

Further Reading