字符'"'怎么写

How to write the character '"'

我想使用包含 ocaml '"' 中的字符的字符串,例如字符串 “这个角色'''很有趣”。 我写了“这个字符'\''很有趣”。但是它不起作用...

像您一样引用它是可行的,但您也可以使用新的字符串定界符:

let () =
  print_endline "This character '\"' is interesting";
  print_endline {|This character '"' is interesting|}