Widely availableSupported across all major browsers. Safe to use in production.

Overview

The String.raw() static method interpolates template literal substitutions, but ignores escape sequences. It is the tag function for template literals.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
41
12
34
9
41
9
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

JAVASCRIPT
String.raw`Hello\
World`;
// 'Hello\\
World' (no line break)

// Windows path
String.raw`C:\Users\Admin\Desktop`;
// 'C:\\Users\\Admin\\Desktop'

Live demo

Windows path. Display

baksrashi that escape-p and,. display and inspect it..

PreviewFullscreen

escape-pcharacter. Disabledization

\n(change row) etc. specialcharacter that. character and output..

PreviewFullscreen

regexpattern. describe

baksrashi useregexpattern split or or describe in..

PreviewFullscreen

Use cases

  • Using String raw()

    The String.raw() static method interpolates template literal substitutions, but ignores escape sequences. It is the tag function for template literals.

Cautions

  • No specific concerns. Stable across all major browsers.

Accessibility

  • When updating the DOM dynamically, announce important changes to assistive technology with aria-live regions.

Powered by web-features