In [1]:
val withoutIndent ="""
ABC
123
456
""".trimIndent()
withoutIndent
Out[1]:
Below sounds like a bug somewhere as it is not what trimIdent
supposed to do.
In [2]:
val sql ="""
select
*
from
some_table
where
id = 100
order by
id
""".trimIndent()
sql
Out[2]:
trimMargin¶
trimMargin
is more flexible and useful than trimIndent
.
In [3]:
val withoutMargin1 = """ABC
|123
|456""".trimMargin()
withoutMargin1
Out[3]:
In [4]:
val withoutMargin2 = """
#XYZ
#foo
#bar
""".trimMargin("#")
withoutMargin2
Out[4]:
In [5]:
val sql ="""
|select
| *
|from
| some_table
|where
| id = 100
|order by
| id
""".trimMargin()
sql
Out[5]:
In [6]:
"".isBlank()
Out[6]:
In [7]:
"""
""".isBlank()
Out[7]:
In [8]:
"a".isBlank()
Out[8]:
split¶
In [2]:
"a b c".split(" ")
Out[2]:
In [ ]: