Conditionals

Want to include a chunk of text in some cases but not others? Conditionals are here to help.

This

$$IfAlways{}
Hello
$$EndIf{}

$$IfNever{}
Goodbye
$$EndIf{}

Becomes

Hello

Conditional syntax

Textcarver supports the following types of conditionals:

$$IfConditional{}
$$IfNotConditional{}

$$ElseIfConditional{}
$$ElseIfNotConditional{}

$$EndIf{}

Supported conditionals

The full list of supported conditionals is:

$$IfAlways{}
$$IfNever{}
$$IfNumArgs{3}
$$IfEmpty{$$var{}}
$$IfEqual{$$var1{} | $$var2{}}
$$IfStartsWith{Hello | $$var{}}
$$IfEndsWith{.txt | $$var{}}
$$IfIncludes{Hello | $}
$$IfIncludesRegex{\d{3} | g | $$var{}}
$$IfEven{$$var{}}
$$IfOdd{$$var{}}
$$IfExists{var}
$$IfFileExists{filePath}
$$IfJS{$$var1{} + $$var2{} > 10;}

Next: Arguments