operator
[operator,match,this,that,match,nomatch\]
[operator,sub,string,length(,start)\]
with keys
[operator,type=match,this=,that=,match=,nomatch=\]
[operator,type=sub,string=,length=(,start=1)\]
String maniplulation
Parameters
type is match - match "this" with "that" returning "match" or "nomatch"
this - string to match
that - string to match with "this"
match - return if "this" matches "that"
nomatch - return if "this" does not match "that
type is sub - extract substring of "length" characters from "string" starting at first character or positon "start"
string - extract substring from this
length - number of characters to extract
start - optional position in string to start extraction (1 - n
Examples
Example#1 match "y" and display "Yes" or "No"
y = [include,answer,y]
x = [include,answer,x]
content/answer:
[operator,type=match,this=[parmeter,1],that=y,match=Yes,nomatch=No]
Output:
y = Yes
x = No
Example#2 extract the first character of a string
Hello = [include,first,Hello]
World = [include,first,World]
content/first:
[operator,type=sub,string=[parmeter,1],length=1,start=1]
Output:
Hello = H
World = W
Example#3 include content if datafield is not blank
[includekeys,price,title=Product A,now=9.99,was=19.99]
[includekeys,price,title=Product B,now=5.99]
content/price:
[datafield,title] is [datafield,now] [includekeys,[operator,type=match,this=[datafield,was],that=, match=,nomatch=previous]]
content/previous:
was [textstyle,font-style:bold;color:#ff0000;][parameter,1][textstyleend]
Output:
Product A is 9.99 was 19.99
Product B is 5.99
Notes