function

find_in_set . string . sncode

VERSIONlatest This function is used to check is a value is set within a list with a delimiter between each element.

FIND_IN_SET

NAME

find_in_set - This function is used to check is a value is set within a list with a delimiter between each element.

SYNOPSIS

find_in_set(values:"…",list:"…",delimiter:"…") find_in_set("values","list"[,"delimiter"])

DESCRIPTION

find_in_set and isset are synonyms.

In the first form, each parameter is named while in the second form, the parameters are positional.

The delimiter is set by default to ",". The delimiter can be more than one character.

It returns 0 if the value is not find in the set. When the value is found, the position is returned starting at 1.

PARAMETERS

LIST
List of values.
VALUES
The value that we searched in the list.
DELIMITER
The delimiter in the list which is set to comma by default.

RETURN

0 if not found.
Position number if found starting at 1.

EXAMPLES

if isset(list:",bb,ccc,d",values:"d",delimiter:",") then
            "found";
   else
            "not";
endif

AUTHOR

Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>