Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

%GetStrItemsCount function


Function
The function retrieves the number of words in the specified text string, while the words are divided by the specified delimiter.
Declaration


Blok kódu
languageesl
themeConfluence
INT %GetStrItemsCount(
   TEXT in string, 
   TEXT in delimiter
 )
Parameters


stringText string.
delimiterDelimiter.
Example


Blok kódu
languageesl
themeRDark
%GetStrItemsCount("John;Michael;Charles;Jack;Martin",";") ; the function returns the value of 5
 
 ; the final values of function in specific cases
 INT _i
  TEXT _tStr,_tStrTest
 
 _tStrTest := "asdf"
 _i := %GetStrItemsCount(_tStrTest,";")  ;_i = 1
  _tStr := %GetStrItem(_tStrTest,1,";")   ;_tStr = "asdf"
 
  _tStrTest := "asdf;"
 _i := %GetStrItemsCount(_tStrTest,";")   ;_i = 2
 _tStr := %GetStrItem(_tStrTest,1,";")   ;_tStr = "asdf"
 _tStr := %GetStrItem(_tStrTest,2,";")   ;_tStr = ""
 
 _tStrTest := ""
 _i := %GetStrItemsCount(_tStrTest,";")  ;_i = 1
 _tStr := %GetStrItem(_tStrTest,1,";")   ;_tStr = ""
 _tStr := %GetStrItem(_tStrTest,2,";")    ;_tStr = ""
 
 _tStrTest := ";"
  _i := %GetStrItemsCount(_tStrTest,";")   ;_i = 2
 _tStr := %GetStrItem(_tStrTest,1,";")   ;_tStr = ""
 _tStr := %GetStrItem(_tStrTest,2,";")   ;_tStr = ""