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.
Get the Free Newsletter
Subscribe to Daily Tech Insider for top news, trends & analysis
This email address is invalid.
Get the Free Newsletter
Subscribe to Daily Tech Insider for top news, trends & analysis
This email address is invalid.

Related Articles

Embedded Analytics

Embedded analytics brings self-service business intelligence to everyday application users.

HRIS

Human resources information system (HRIS) solutions help businesses manage multiple facets of their workforce operations. They provide a central platform for human resources professionals...

Complete List of Cybersecurity Acronyms

Cybersecurity news and best practices are full of acronyms and abbreviations. Without understanding what each one means, it's difficult to comprehend the significance of...

Human Resources Management System

A Human Resources Management System (HRMS) is a software application that supports many functions of a company's Human Resources department, including benefits administration, payroll,...

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...