Home »
Code Examples »
Scala Code Examples
Scala - How to create a multi-line text using stripMargin? Code Example
The code for How to create a multi-line text using stripMargin?
val Info: String =
"""
|{
|"kingdome":"Ayodhya",
|"king":"Shri Ramchandra",
|"years_ruled":11000
|}
"""
.stripMargin
println("Creating multi-line text using stripMargin")
println(Info)
/*
Creating multi-line text using stripMargin
{
"kingdome":"Ayodhya",
"king":"Shri Ramchandra",
"years_ruled":11000
}
*/
Code by IncludeHelp,
on August 8, 2022 03:37