Miscellaneous: Raw string literals

code

Syntax

The purpose of raw string literals is to no longer have the need to escape characters such as \ ? ” by using another slash before that character (eg. \\ \? \”)

PROS

  • Code is clearer

CONS

  • The syntax is not very friendly: R”(example)”

 

Paranthesis? Why we have those?

  • The purpose of the parentheses is to allow you to specify a custom delimiter. In our previous example was empty.

R“delimiter(\?”) delimiter“;

R“#####(\?”) #####“;

R”foo(\?”)foo

 

Leave a comment

Your email address will not be published.