From Xojo Documentation
| This item was deprecated in version 2019r2, however it continues to work.
Please use String.NthField as a replacement.
Returns a field from a row of data. The first field is numbered 1. If you need to parse binary data, use NthFieldB instead.
result=NthField(source, separator, fieldNumber)
result=stringVariable.NthField(separator, fieldNumber) Introduced 5.0
|result||String||The field value desired.|
|source||String||The string that contains the desired field, with the field separated by the Separator string.|
|separator||String||The string that separates columns of data.|
|fieldNumber||Integer||The column number of the desired field. The first field is numbered 1.|
|stringVariable||String||Any variable of type String.|
The NthField function returns the field value from the source that precedes the fieldNumber occurrence of the separator in the source.
The separator may be a string of any length.
If fieldNumber is out of bounds, an empty string is returned. NthField is not case-sensitive.
|Using NthField in a loop to extract fields from a string is inefficient. You should use Split for this purpose.|
This example returns "Smith"
Using the second syntax:
s = "Dan*Smith*11/22/69*5125554323*Male"
field = s.NthField("*", 2)
This example demonstrates the use of a multiple character separator.
Dim wed As String = NthField(days, ",", 3) // sets wed to "Wednesday"