String Interpolation

Noun · Development

Definitions

  1. A language feature that embeds expressions directly inside string literals, evaluating them at runtime and inserting the results into the final string. Examples include JavaScript template literals (`${expr}`), Python f-strings (`f"{expr}"`), and Ruby (`"#{expr}"`).

    In plain English: A way to insert variable values or calculations directly into a piece of text without manually gluing strings together.

    Example: "Use an f-string instead of concatenation — `f'Hello, {name}'` is way more readable than 'Hello, ' + name."

Related Terms