On Thu, 5 Sep 2019, Artur Tarassow wrote:
Hi all,
quite frequently I need to scan a string array for a specific string value.
Either I need just a boolean return for (non-)existent but sometimes also the
entry number of string s2 in array s2.
I've written two function proposals (see attached files or here:
https://github.com/atecon/instrings) which may be added to the extra.gfn
package if you agree. What I've called instrings_pos() [name it just
instrings()] would be the more general idea though.
I like these, and I think this is potentially useful. There's only one
thing I'd like to think about a bit more. In some cases, one may need the
equivalent of the ".=" operator, that is a function that does not just
return the first occurrence, if any, but a whole binary array. Modifying
your function instrings_pos() to this effect would be trivial. Do you
think it worthwhile?
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------