Raw String

A raw string in programming allows all characters in a string literal to remain the same in code and in the material, rather than performing their standard programming functions. Raw strings are denoted with the letter r, or capital R, and might look something like this:

R “(hello)”

This allows characters that would otherwise trigger specific formatting to read as their literal value instead. A backslash () is a good example: these are often combined with other characters to denote a specific action in programming. Different programming languages have different patterns for raw strings, and they may have different delimiters, but most raw strings take the same general form.

Delimiters in raw strings

Raw strings avoid using escape sequences, which automatically trigger a different feature within the code (such as a paragraph break or other function). In the earlier example of a raw string: 

R “(hello)”

the parentheses or quotations can both function as delimiters, which segment string literals properly. Delimiters designate a string literal. Characters or strings that need to be separated are often parenthetical or bracketed. Different programming languages will use different delimiters, but they must delineate the separation of strings clearly. In this case, R indicates a raw string, and everything within the parentheses will read as its literal character value.

Webopedia Staff
Webopedia Staff
Since 1995, more than 100 tech experts and researchers have kept Webopedia’s definitions, articles, and study guides up to date. For more information on current editorial staff, please visit our About page.

Related Articles

@ Sign

Pronounced at sign or simply as at, this symbol is used in e-mail addressing to separate the user' name from the user's domain name,...

Munging

(MUHN-jing) Munging (address munging), is the act of altering an email address posted on a Web page to make it unreadable to bots and...

How to Create an RSS Feed

In the second installment of RSS how-to, we look at some of the nonrequired (optional) channel and item tags, discuss RSS specifications in-depth and...

Dictionary Attack

(n.) (1) A method used to break security systems, specifically password-based security systems, in which the attacker systematically tests all possible passwords beginning with...

ScalaHosting

ScalaHosting is a leading managed hosting provider that offers secure, scalable, and affordable...

HRIS

Human resources information system (HRIS) solutions help businesses manage multiple facets of their...

Best Managed Service Providers...

In today's business world, managed services are more critical than ever. They can...