I observe an issue with the macro command extract.
The following codes shows the issue:
In the 1st and 2nd case, the output is as expected: Orange
In the 3rd case, the output is also as expected: Oranges (note the additional s).
In the 4th case however, the output is Orange (without the additional s). To me, that is unexpected and wrong.
I would have expected this output if there would be "sss" at the end, but not when there is only a single "s".
The problem is not dependant on using letters, as is show by the 5th case.
Here I would expect "Orange-" to be the result, but instead "Orange" is reported.
The following codes shows the issue:
GSK |
$Data = "Apple;Pear;Orange" $Fruit = Extract($Data, ";", 3) MsgOk msg=$Data / $Fruit $Data = "Apple---Pear---Orange" $Fruit = Extract($Data, "---", 3) MsgOk msg=$Data / $Fruit $Data = "Apple;Pear;Oranges" $Fruit = Extract($Data, ";", 3) MsgOk msg=$Data / $Fruit $Data = "ApplesssPearsssOranges" $Fruit = Extract($Data, "sss", 3) MsgOk msg=$Data / $Fruit $Data = "Apple---Pear---Orange-" $Fruit = Extract($Data, "---", 3) MsgOk msg=$Data / $Fruit |
In the 1st and 2nd case, the output is as expected: Orange
In the 3rd case, the output is also as expected: Oranges (note the additional s).
In the 4th case however, the output is Orange (without the additional s). To me, that is unexpected and wrong.
I would have expected this output if there would be "sss" at the end, but not when there is only a single "s".
The problem is not dependant on using letters, as is show by the 5th case.
Here I would expect "Orange-" to be the result, but instead "Orange" is reported.