title: Filters/substitute
description: Test substitute operator
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]

title: substitute filter data 1
tags: Hello There [[Welcome to TiddlyWiki]] GettingStarted

TiddlyWiki
+
title: substitute filter data 2

The output of the filter `[[substitute filter data 1]tags[]]` is ${[[substitute filter data 1]tags[]]}$.
+
title: substitute filter data 3

Welcome to $(projectname)$ $1$ $2$ $3$. Tiddlers starting with `substitute`: ${[prefix[substitute]format:titlelist[]join[ ]]}$.
+
title: Output

\whitespace trim
<$let projectname="TiddlyWiki">
(<$text text={{{ [[]substitute[]] }}}/>)
(<$text text={{{ [[Hello There, welcome to $TiddlyWiki$]substitute[]] }}}/>)
(<$text text={{{ [[Welcome to $(projectname)$]substitute[]] }}}/>)
(<$text text={{{ [[Welcome to $(projectname)$ $1$]substitute[today]] }}}/>)
(<$text text={{{ [[This is not a valid embedded filter ${ hello )$]substitute[]] }}}/>)
(<$text text={{{ [{substitute filter data 2}substitute[]] }}}/>)
(<$text text={{{ [{substitute filter data 3}substitute[every],[day]] }}}/>)
</$let>
+
title: ExpectedResult

<p>()
(Hello There, welcome to $TiddlyWiki$)
(Welcome to TiddlyWiki)
(Welcome to TiddlyWiki today)
(This is not a valid embedded filter ${ hello )$)
(The output of the filter `[[substitute filter data 1]tags[]]` is Hello.)
(Welcome to TiddlyWiki every day $3$. Tiddlers starting with `substitute`: [[substitute filter data 1]] [[substitute filter data 2]] [[substitute filter data 3]].)</p>