String interpolation
Replacing placeholders in a string with values
Replacing placeholders in a string with values
In computer programming, string interpolation (or variable interpolation, variable substitution, or variable expansion) is the process of evaluating a string literal containing one or more placeholders, yielding a result in which the placeholders are replaced with their corresponding values. It is a form of simple template processing or, in formal terms, a form of quasi-quotation (or logic substitution interpretation). The placeholder may be a variable name, or in some languages an arbitrary expression, in either case evaluated in the current context. String interpolation is an alternative to building a string via concatenation, which requires repeat quoting and unquoting; or substituting into a printf format string, where the variable is far from where it is used. Consider this example in Ruby: Two types of literal expression are usually offered: one with interpolation enabled, the other without. Non-interpolated strings may also escape sequences, in which case they are termed a raw string...
Open boosters, collect cards and trade them. Free to play.
Play for free