Asterisk func fieldqty

Synopsis

Count the fields, with an arbitrary delimiter

Description

FIELDQTY(<varname>,<delim>)
at least on asterisk 1.4.21.2 the parameters must be separated by "|" and not ","


Notes

  • *CLI> show function FIELDQTY

Return value

Returns the resulting count.

Examples

exten => s,1,Set(foo=${FIELDQTY(bigvar,#)})

exten => 123,1,Set(Var=hello#you#there#on#the#telephone)
exten => 123,n,Set(Count=${FIELDQTY(Var|#)}) ; Count ist 6


See also

  • Asterisk func CUT: Slices and dices a value into pieces/words
  • Asterisk func POP: Removes and returns the last item off of a variable containing delimited text
  • Asterisk func SHIFT: Removes and returns the first item off of a variable containing delimited text
  • Asterisk func LISTFILTER as introduced with Asterisk 1.6.2: Remove elements from a set list (by name)
  • Asterisk func array
  • Asterisk variables
  • Asterisk functions


Synopsis

Count the fields, with an arbitrary delimiter

Description

FIELDQTY(<varname>,<delim>)
at least on asterisk 1.4.21.2 the parameters must be separated by "|" and not ","


Notes

  • *CLI> show function FIELDQTY

Return value

Returns the resulting count.

Examples

exten => s,1,Set(foo=${FIELDQTY(bigvar,#)})

exten => 123,1,Set(Var=hello#you#there#on#the#telephone)
exten => 123,n,Set(Count=${FIELDQTY(Var|#)}) ; Count ist 6


See also

  • Asterisk func CUT: Slices and dices a value into pieces/words
  • Asterisk func POP: Removes and returns the last item off of a variable containing delimited text
  • Asterisk func SHIFT: Removes and returns the first item off of a variable containing delimited text
  • Asterisk func LISTFILTER as introduced with Asterisk 1.6.2: Remove elements from a set list (by name)
  • Asterisk func array
  • Asterisk variables
  • Asterisk functions


Created by: murf, Last modification: Sun 30 of Dec, 2012 (13:11 UTC) by JustRumours
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+