Question: count number of elements in SearchAll

Any idea how I can get the number of elements in an exprseq after a SearchAll command?

numelems apparently is not the right function.


 

with(StringTools)

a := "tre - tre - tre"

"tre - tre - tre"

(1)

b := SearchAll("-", a)

5, 11

(2)

whattype(b)

exprseq

(3)

numelems(b)

Error, invalid input: numelems expects 1 argument, but received 2

 

``


 

Download numelems.mw

Please Wait...