diff options
author | Domen Vrankar <domen.vrankar@gmail.com> | 2014-11-12 22:57:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-11-13 16:04:52 (GMT) |
commit | 474bbb9dbcd6c257e68874e6966c145b3b82dbdd (patch) | |
tree | 8ede20f72deac3bf628c81a1e581035a8756364b /Help/command | |
parent | a9a040e1698a7caf9518c27d3394293e7fe11d59 (diff) | |
download | CMake-474bbb9dbcd6c257e68874e6966c145b3b82dbdd.zip CMake-474bbb9dbcd6c257e68874e6966c145b3b82dbdd.tar.gz CMake-474bbb9dbcd6c257e68874e6966c145b3b82dbdd.tar.bz2 |
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.
Diffstat (limited to 'Help/command')
-rw-r--r-- | Help/command/string.rst | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Help/command/string.rst b/Help/command/string.rst index 07d0ff3..351385b 100644 --- a/Help/command/string.rst +++ b/Help/command/string.rst @@ -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. |