summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r--src/corelib/text/qstring.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 4e220c4453..091f44736e 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -4613,7 +4613,8 @@ QString QString::section(const QRegularExpression &re, qsizetype start, qsizetyp
Returns a substring that contains the \a n leftmost characters
of the string.
- \obsolete Use first() instead in new code.
+ If you know that \a n cannot be out of bounds, use first() instead in new
+ code, because it is faster.
The entire string is returned if \a n is greater than or equal
to size(), or less than zero.
@@ -4631,7 +4632,8 @@ QString QString::left(qsizetype n) const
Returns a substring that contains the \a n rightmost characters
of the string.
- \obsolete Use last() instead in new code.
+ If you know that \a n cannot be out of bounds, use last() instead in new
+ code, because it is faster.
The entire string is returned if \a n is greater than or equal
to size(), or less than zero.
@@ -4649,7 +4651,8 @@ QString QString::right(qsizetype n) const
Returns a string that contains \a n characters of this string,
starting at the specified \a position index.
- \obsolete Use sliced() instead in new code.
+ If you know that \a position and \a n cannot be out of bounds, use sliced()
+ instead in new code, because it is faster.
Returns a null string if the \a position index exceeds the
length of the string. If there are less than \a n characters
@@ -9114,7 +9117,8 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size)
Returns the substring of length \a length starting at position
\a start in this Latin-1 string.
- \obsolete Use sliced() instead in new code.
+ If you know that \a start and \a length cannot be out of bounds, use sliced()
+ instead in new code, because it is faster.
Returns an empty Latin-1 string if \a start exceeds the
length of this Latin-1 string. If there are less than \a length characters
@@ -9129,7 +9133,8 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size)
\fn QLatin1String QLatin1String::left(qsizetype length) const
\since 5.8
- \obsolete Use first() instead in new code.
+ If you know that \a length cannot be out of bounds, use first() instead in
+ new code, because it is faster.
Returns the substring of length \a length starting at position
0 in this Latin-1 string.
@@ -9144,7 +9149,8 @@ QString &QString::setRawData(const QChar *unicode, qsizetype size)
\fn QLatin1String QLatin1String::right(qsizetype length) const
\since 5.8
- \obsolete Use last() instead in new code.
+ If you know that \a length cannot be out of bounds, use last() instead in
+ new code, because it is faster.
Returns the substring of length \a length starting at position
size() - \a length in this Latin-1 string.