## String::ToByteArray method


Converts string or substring to array of bytes.

```cpp
ArrayPtr<uint8_t> System::String::ToByteArray(int32_t startIndex=0, int32_t length=INT32_MAX, bool LE=true) const
```


| Parameter | Type | Description |
| --- | --- | --- |
| startIndex | int32_t | Substring start index. |
| length | int32_t | Substring length. |
| LE | bool | If true, encode characters using little endianness; otherwise, use big endianness. |

### ReturnValue

[Array](../../array/) containing bytes representing characters of the string.

## See Also

* Typedef [ArrayPtr](../../arrayptr/)
* Class [String](../)
* Namespace [System](../../)
* Library [Aspose.Font for C++](../../../)
