# tensorflow::ops::StringSplit Class Reference

# tensorflow::
ops::
StringSplit

`
#include <string_ops.h>
`


Split elements of
`
input
`
based on
`
delimiter
`
into a
`
SparseTensor
`
.

## Summary


Let N be the size of source (typically N will be the batch size). Split each element of
`
input
`
based on
`
delimiter
`
and return a
`
SparseTensor
`
containing the splitted tokens.
[Empty](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/empty#classtensorflow_1_1ops_1_1_empty)
tokens are ignored.


`
delimiter
`
can be empty, or a string of split characters. If
`
delimiter
`
is an empty string, each element of
`
input
`
is split into individual single-byte character strings, including splitting of UTF-8 multibyte sequences. Otherwise every character of
`
delimiter
`
is a potential split point.


For example: N = 2, input\[0\] is 'hello world' and input\[1\] is 'a b c', then the output will be


indices = \[0, 0; 0, 1; 1, 0; 1, 1; 1, 2\] shape = \[2, 3\] values = \['hello', 'world', 'a', 'b', 'c'\]


Args:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- input: 1-D. Strings to split.
- delimiter: 0-D. Delimiter characters (bytes), or empty string.

<br />


Optional attributes (see
`
https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/string-split/attrs#structtensorflow_1_1ops_1_1_string_split_1_1_attrs
`
):

- skip_empty: A `
  bool
  ` . If `
  True
  ` , skip the empty strings from the result.

<br />


Returns:

- `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` indices: A dense matrix of int64 representing the indices of the sparse tensor.
- `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` values: A vector of strings corresponding to the splited values.
- `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` shape: a length-2 vector of int64 representing the shape of the sparse tensor, where the first value is N and the second value is the maximum number of tokens in a single input entry.

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/string-split#classtensorflow_1_1ops_1_1_string_split_1ab3e43561fc94bb0cf1dc324ae780b058 (const :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input input, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input delimiter) ` ||
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/string-split#classtensorflow_1_1ops_1_1_string_split_1aa084e3f7532182e407e239142972f206 (const :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input input, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input delimiter, const https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/string-split/attrs#structtensorflow_1_1ops_1_1_string_split_1_1_attrs & attrs) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/string-split#classtensorflow_1_1ops_1_1_string_split_1ad78d9029594ea73a2d6f82864344d45d ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/string-split#classtensorflow_1_1ops_1_1_string_split_1a9f13bcd1e34600b3a8b14445d59142a2 ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/string-split#classtensorflow_1_1ops_1_1_string_split_1a008b2049c8b2b2c39f057bd4162dc3c2 ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/string-split#classtensorflow_1_1ops_1_1_string_split_1ae71dfe97b78a0999e771725948f9ab04 ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output ` |

| ### Public static functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/string-split#classtensorflow_1_1ops_1_1_string_split_1af6097b372cd021e78a46d3f6076c6745 (bool x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/string-split/attrs#structtensorflow_1_1ops_1_1_string_split_1_1_attrs ` |

| ### Structs ||
|---|---|
| [tensorflow:: ops:: StringSplit:: Attrs](https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/string-split/attrs) | Optional attribute setters for [StringSplit](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/string-split#classtensorflow_1_1ops_1_1_string_split) . |

## Public attributes

### indices

```
::tensorflow::Output indices
```

### operation

```
Operation operation
```

### shape

```
::tensorflow::Output shape
```

### values

```
::tensorflow::Output values
```

## Public functions

### StringSplit

```
 StringSplit(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input delimiter
)
```

### StringSplit

```
 StringSplit(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input delimiter,
  const StringSplit::Attrs & attrs
)
```

## Public static functions

### SkipEmpty

```
Attrs SkipEmpty(
  bool x
)
```