Skip to main content

Questions tagged [string-interpolation]

For questions relating to string interpolation, or the evaluation of strings with certain placeholders for expressions.

Filter by
Sorted by
Tagged with
7 votes
9 answers
461 views

What are the different syntax options for formatted string literals?

One option in Python is the f-string: f"{a} {b} {c}" Which is equivalent to: ...
The Thonnu's user avatar
  • 1,508
11 votes
6 answers
304 views

What ways exist for handling object to string conversion?

For example: Java uses a toString() method, and calls that behind the scenes. If you don't implement one, you inherit it from the base class (...
Bbrk24's user avatar
  • 9,017
9 votes
3 answers
429 views

How can I handle interpolated expressions in string literals?

I've written what I think is a fairly typical compiler frontend: I have a lexer that produces a list of tokens, then I give that list to a recursive-descent parser that produces the syntax tree. This ...
Michael Homer's user avatar
  • 12.9k