Function: count_chosen

Function: count_chosen

since 0.3.7


 count_chosen(choices: some_string, some_multiple_choice_value)

Coint the number of choices that are selected in a multiple choice value.

If the choices parameter is given then only choices from that list are counted.


Parameter Type Description
input string Multiple choice value to look in.
choices optional string A comma separated list of choices to look for.


 count_chosen("")                                 ==  0
 count_chosen("red")                              ==  1
 count_chosen("red, green")                       ==  2
 count_chosen("red, green", choices: "red,blue")  ==  1

See also

chosen Is a given choice selected in a multiple choice value?