I need a string with double quotes
tried
expectedValue = "/""+expectedValue+"/""
but did not worked -
Throws below error -
NoMethodError: undefined method `/' for "/+expectedValue+":String
Please suggest.
Probably you mean:
expectedValue = "\""+expectedValue+"\""
or more in ruby style:
expectedValue = "\"#{expectedValue}\""
You can use %Q
, or simply %
expectedValue = %Q{"#{expectedValue}"}
expectedValue = %|"#{expectedValue}"|
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.