Fsharp: At Sign @ String

By Xah Lee. Date: .

At Sign @ String

// to include a quote, double it
let xx = @"said: ""yes""."
printfn "%s" xx
// said: "yes".
// can be multiple lines
let xx = @"aa
bb"
printfn "%s" xx
(*
aa
bb
 *)
// backslash has no special meaning

let xx = @"aa\nbb"
printfn "%s" xx
// aa\nbb

let zz = @"aa\
   bb"
printfn "%s" zz

(*
aa\
   bb
 *)
// at sign can be placed in front of triple quoted string
let xx = @"""abc"""
printfn "%s" xx
// "abc"

// double quoted inside means single
let zz = @"""ab""cd"""
printfn "%s" zz
// "ab"cd"

Fsharp, String