<div class="meta" robots="noindex">

</div>

Method

# NthFieldB

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `MemoryBlock</api/language/memoryblock>` as a replacement.

</div>

## Description

Returns a field from a row of data. <span class="title-ref">NthFieldB</span> is identical to `String.NthField<string.nthfield>` except that it treats the source data as binary data. The first field is numbered 1.

## Usage

*result*=**NthFieldB**(*source*, *separator*, *fieldNumber*)

**OR**

*result*=*stringVariable*.**NthFieldB**(*separator*, *fieldNumber*)

| Part           | Type                               | Description                                                                                        |
|----------------|------------------------------------|----------------------------------------------------------------------------------------------------|
| result         | `String</api/data_types/string>`   | The field value desired.                                                                           |
| source         | `String</api/data_types/string>`   | The string that contains the desired field, with the field separated by the *Separator* character. |
| separator      | `String</api/data_types/string>`   | The character that separates the columns of data.                                                  |
| fieldNumber    | `Integer</api/data_types/integer>` | The column number of the desired field. The first field is numbered 1.                             |
| stringVariable | `String</api/data_types/string>`   | Any variable of type `String</api/data_types/string>`.                                             |

## Notes

The <span class="title-ref">NthFieldB</span> function returns the field value from the source that precedes the *fieldNumber* occurrence of the separator in the source.

If *fieldNumber* is out of bounds, an empty string is returned. <span class="title-ref">NthFieldB</span> is not case-sensitive.

## Sample code

This example returns "Smith"

``` xojo
Dim field As String
field = NthFieldB("Dan*Smith*11/22/69*5125554323*Male", "*", 2)
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Using the second syntax:

``` xojo
Dim s, field As String
s = "Dan*Smith*11/22/69*5125554323*Male"
field = s.NthFieldB("*", 2)
MsgBox(field)
```

## Compatibility

All project types on all supported operating systems.

## See also

`MemoryBlock</api/language/memoryblock>`, `String.NthField<string.nthfield>`, `String.SplitBytes<string.splitbytes>` functions.
