Hi,String Interpolation means replacement of defined variables or expressions in the string with values. We should use s String Interpolator to define processed String Literal as shown below:
Example:-
scala> val definedVariableOne = "Questions"
definedVariables: String = Questions
scala>val definedVariableTwo = "QueryHome"
definedVariableTwo: String =For QueryHome
scala>val siteOne = "Site($definedVariableOne For for $definedVariableTwo)"
detailOne: String =Site($definedVariableOne For for $definedVariableTwo)
scala>val detailTwo = s"Site($definedVariableOne For for $definedVariableTwo)"
detailTwo: String = Site(Questions For QueryHome)
If we observe both detailOne and detailTwo results, we can observe that in detailTwo we have used String Interpolation concept that’s why that String is evaluated to correct expected result.