added trim operand function.
This commit is contained in:
parent
f7812821b3
commit
5cefb0974b
@ -78,7 +78,13 @@ namespace jet {
|
|||||||
} else
|
} else
|
||||||
throw coreutils::Exception("Expecting ) at end of RIGHT expression.");
|
throw coreutils::Exception("Expecting ) at end of RIGHT expression.");
|
||||||
} else if(in.ifNextIgnoreCase("TRIM")) {
|
} else if(in.ifNextIgnoreCase("TRIM")) {
|
||||||
|
if(!in.ifNext("("))
|
||||||
|
throw coreutils::Exception("Expecting ( for TRIM parameters.");
|
||||||
|
Operand parm1(in, tag);
|
||||||
|
if(in.ifNext(")")) {
|
||||||
|
string = parm1.string.trim();
|
||||||
|
} else
|
||||||
|
throw coreutils::Exception("Expecting ) at end of TRIM expression.");
|
||||||
} else if(in.ifNextIgnoreCase("TOUPPER")) {
|
} else if(in.ifNextIgnoreCase("TOUPPER")) {
|
||||||
|
|
||||||
} else if(in.ifNextIgnoreCase("TOLOWER")) {
|
} else if(in.ifNextIgnoreCase("TOLOWER")) {
|
||||||
|
@ -8,4 +8,6 @@ $[test2]=10
|
|||||||
$[lefty]=01234
|
$[lefty]=01234
|
||||||
<set name="righty" expr="right($[numbers],5)" />
|
<set name="righty" expr="right($[numbers],5)" />
|
||||||
$[righty]=56789
|
$[righty]=56789
|
||||||
|
<set name="trim" expr="trim(' this is a test ')" />
|
||||||
|
$[trim]=this is a test
|
||||||
</jet>
|
</jet>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user