mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 21:59:54 -06:00
string: Tolerate SUBSTRING length exceeding end index
string SUBSTRING command now ignores length if it points past end of string and uses end of string instead. String SUBSTRING tests now cover more corner cases.
This commit is contained in:
@@ -73,8 +73,13 @@ TOUPPER/TOLOWER will convert string to upper/lower characters.
|
||||
|
||||
LENGTH will return a given string's length.
|
||||
|
||||
SUBSTRING will return a substring of a given string. If length is -1
|
||||
SUBSTRING will return a substring of a given string. If length is -1
|
||||
the remainder of the string starting at begin will be returned.
|
||||
If string is shorter than length then end of string is used instead.
|
||||
|
||||
.. note::
|
||||
CMake 3.1 and below reported an error if length pointed past
|
||||
the end of string.
|
||||
|
||||
STRIP will return a substring of a given string with leading and
|
||||
trailing spaces removed.
|
||||
|
||||
Reference in New Issue
Block a user