- Qt 6.9
- Qt Core
- C++ Classes
- QUtf8StringView
- Qt 6.9.3 Reference Documentation

# Obsolete Members for QUtf8StringView

The following members of class QUtf8StringView are deprecated. They are provided to keep old source code working. We strongly advise against using them in new code.

## Public Functions

`(deprecated)` QUtf8StringView | left(qsizetype n) const
`(deprecated)` QUtf8StringView | mid(qsizetype pos, qsizetype n = -1) const
`(deprecated)` QUtf8StringView | right(qsizetype n) const

## Member Function Documentation

### `[constexpr, deprecated]` QUtf8StringView QUtf8StringView::left(qsizetype n) const

This function is deprecated. We strongly advise against using it in new code.

Use first() instead in new code.

Returns the substring of length n starting at position 0 in this object.

The entire string view is returned if n is greater than or equal to size(), or less than zero.

See also first(), last(), sliced(), chopped(), chop(), truncate(), and slice().

### `[constexpr, deprecated]` QUtf8StringView QUtf8StringView::mid(qsizetype pos, qsizetype n = -1) const

This function is deprecated. We strongly advise against using it in new code.

Returns the substring of length n starting at position pos in this object.

Use sliced() instead in new code.

Returns an empty string view if n exceeds the length of the string view. If there are less than n code points available in the string view starting at pos, or if n is negative (default), the function returns all code points that are available from pos.

See also first(), last(), sliced(), chopped(), chop(), truncate(), and slice().

### `[constexpr, deprecated]` QUtf8StringView QUtf8StringView::right(qsizetype n) const

This function is deprecated. We strongly advise against using it in new code.

Use last() instead in new code.

Returns the substring of length n starting at position size() - n in this object.

The entire string view is returned if n is greater than or equal to size(), or less than zero.

See also first(), last(), sliced(), chopped(), chop(), truncate(), and slice().