Stylianos Gakis
02/24/2022, 9:20 AMString.replace
function to replace some text. Specifically there was a place where this shows:
"""
"""
And I’d just like to replace it with:
"""
I was looking to use a triple quote String as I really like how I don’t need to escape stuff in there because it confuses me, but then I end up in this situation where I can’t really match a “”" inside it as it closes the string 😅 Is my only solution here to not use triple quotes since I can’t escape a “”" in there probably right? With a “\”\“\”\n \“\”\“” string instead?Sam
02/24/2022, 9:28 AMconst val qqq = "\"\"\""
val x = """$qqq
$qqq"""
println(x)
ephemient
02/24/2022, 11:26 AM"""
with
val x = """
""${'"'}
""${'"'}
"""
as well, but in this case I'd find Sam's solution or
val x = """
qqq
qqq
""".replace('q', '"')
to be cleanerStylianos Gakis
02/24/2022, 11:37 AM