{@StringDQ}

Product: 

Class: 

Warning

uCalc API Preview Release Notice:The uCalc engine has successfully transitioned to modern cross-platform environments.The next phase envolves some structural changes, performance optimizations, and API refinements.The API is subject to breaking changes prior to the stable release. Please evaluate the preview version thoroughly before production use.

Remarks

Shortcut: {@dqs}

Description: A specialized category matcher that identifies double-quoted string literals (" "), including triple double-quotes (""" """) and interpolated double-quoted strings.

The {@StringDQ} directive (shorthand {@dqs}) is used within a uCalc::Transformer to target literals specifically enclosed in double quotation marks. While the master {@String} (Topic 799) directive matches any string literal, {@StringDQ} provides the precision needed when a transformation only applies to a specific syntax style.

Supported Formats

  • Standard Double Quotes: "Content"
  • Triple Double Quotes: """Multi-line content"""
  • Interpolated Double Quotes: $"{expression}" (Captured structurally via balanced braces).

Advanced Capture: Suffix Indexing

When capturing a string with a named variable (e.g., {@dqs:txt}), you can control whether the delimiters are included in the replacement logic:

  • {txt(0)}: Returns the full string including the double quotes (e.g., "Hello").
  • {txt(1)}: Returns the inner content only (e.g., Hello). {txt} defaults to {txt(1)}

Comparison with Specific Matchers

DirectiveScopeUse Case
{@String}Any StringGeneral data handling where quote style doesn't matter.
{@StringDQ}" onlyJSON parsing or C# code generation where " is mandatory.
{@StringSQ}' onlySQL or Javascript specific transformations.

Inverse Matching with !

The universal inversion operator ! can be applied to this category:

  • {@dqs}: Matches a double-quoted string.
  • {!dqs}: Matches any token that is not a double-quoted string (including single-quoted strings).


Strategy & Critique

  • Precision: In environments like JSON, where single quotes are invalid, {@dqs} is a mandatory tool for ensuring structural validity.
  • Redundancy: Remind users that {@dqs} is a subset of {@String}. If a rule should apply to both types, use the parent directive to keep the code DRY (Don't Repeat Yourself).
  • Naming: The shorthand {@dqs} is highly efficient, though the full name {@StringDQ} should be used in documentation for clarity.

Current Time: Tuesday, January 13, 2026 at 9:48 PM EST.

Examples

This page last modified on: 

8/21/2026