How to insert double quotes into String with interpolation in scala

后端 未结 11 1577
北荒
北荒 2020-12-05 12:53

Having trouble escaping all the quotes in my function

(basic usage of it -> if i find a string do nothing, if its not a string add \" in the begin and end)

11条回答
  •  情歌与酒
    2020-12-05 13:17

    This fixed the problem for me, I tested this out and this is what I used.

    raw""" 
       Inside this block you can put "as many" quotes as you "want" and even "${5 + 7}" interpolate inside the quotes 
    """
    

    http://docs.scala-lang.org/overviews/core/string-interpolation.html#the-raw-interpolator

提交回复
热议问题