Home

substituteswith

Substituteswith is a term used in programming, data processing, and templating to describe an operation that replaces occurrences of a given value, pattern, or placeholder with another value. The phrase is not a standardized keyword in any single language, but appears as a function or method name in various libraries and frameworks, with spellings such as substitutesWith or substitutes_with.

In string processing, substituteswith typically takes at least two arguments: the target to replace and the

Semantics of substituteswith can vary: it may be pure, returning a new value without altering the original

See also: replace, substitute, mapping, templating, pattern matching. Note that substituteswith is not a universal standard

replacement
value.
It
may
also
accept
options
such
as
global
replacement
(all
occurrences
versus
the
first),
case
sensitivity,
and
escaping
rules.
In
data
transformation,
substituteswith
can
operate
on
elements
of
a
collection,
substituting
according
to
a
mapping
or
predicate.
Some
implementations
support
conditional
substitution,
where
a
value
is
swapped
only
if
another
condition
holds,
and
might
allow
complex
patterns
or
regular
expressions
as
targets.
input,
or
it
may
perform
in-place
modification
in
languages
that
allow
mutable
data.
It
can
also
be
used
in
a
partially
applied
form,
creating
a
function
that
applies
a
fixed
replacement
to
any
input.
This
flexibility
makes
substituteswith
a
common
concept
in
template
engines,
data
pipelines,
and
functional
utilities,
even
though
its
exact
behavior
is
library-dependent.
term;
its
meaning
is
defined
by
the
library
or
language
in
which
it
appears.