GetNumFields
Returns the number of fields in the string. The field is a substring that does not contain spaces, tabs or commas.
Syntax
GetNumFields(stringWithFields)
Parameters
Parameter |
Type |
Description |
---|---|---|
stringWithFields |
string |
The string containing fields. The field is a substring that does not contain spaces, tabs or commas |
Return
Returns the number of fields in the string. The field is a substring that does not contain spaces, tabs or commas.
Note
In Python, use split() method of string object: https://www.tutorialspoint.com/python/string_split.htm .
Examples
Python
import nex
numFields = nex.GetNumFields("One two 3 4")
# numFields is now equal to 4
NexScript
numFields = GetNumFields("One two 3 4")
% numFields is now equal to 4