Comparing strings (Moodle Formulas)

Comparing strings (Moodle Formulas)

by Ton Boerkoel -
Number of replies: 1

Is there a way in Moodle Formulas to compare strings?

For example I would like to be able to 

(1) determine if two strings are equal:  x="ab"  and  y="b"   then e.g.  (x==y)?0:1 cannot be evaluated 

      Is there a function that would give  f(x,y)=false  and  f(x,x)=true  ( or f(x,y)=0  and  f(x,x)=1 ) ?

(2) determine if a given string like  x="ab" is in a list like   ["0a","1a","ab","b1"]

and

(3) where in a string like "0a1aabb1"  the string "ab" is located?

     For example in the TI-Nspire there is a function called inString:       inString( "0a1aabb1" , "ab" ) = 5


Average of ratings: -
In reply to Ton Boerkoel

Re: Comparing strings (Moodle Formulas)

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Not for the moment. Some sting functions will be implemented in the next version of the Formulas plugin which should be available by the end of the month.