diff options
author | Tomasz Chabora <kobewi4e@gmail.com> | 2020-02-13 16:42:49 +0100 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2021-05-20 23:07:57 +0200 |
commit | b1859510ab0a3381e0a5bec3d896032fc5019147 (patch) | |
tree | 8f7d3e9b6d31b645db48de3d4e02cc3a485588da /doc | |
parent | 78d85de13be383b24252a38e42bec5be81721ea7 (diff) |
Change behavior of String.right
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/String.xml | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 416438e648..a81defa16c 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -397,7 +397,12 @@ <argument index="0" name="position" type="int"> </argument> <description> - Returns a number of characters from the left of the string. + Returns a number of characters from the left of the string. If negative [code]position[/code] is used, the characters are counted downwards from [String]'s length. + Examples: + [codeblock] + print("sample text".left(3)) #prints "sam" + print("sample text".left(-3)) #prints "sample t" + [/codeblock] </description> </method> <method name="length" qualifiers="const"> @@ -669,7 +674,12 @@ <argument index="0" name="position" type="int"> </argument> <description> - Returns the right side of the string from a given position. + Returns a number of characters from the right of the string. If negative [code]position[/code] is used, the characters are counted downwards from [String]'s length. + Examples: + [codeblock] + print("sample text".right(3)) #prints "ext" + print("sample text".right(-3)) #prints "ple text" + [/codeblock] </description> </method> <method name="rpad" qualifiers="const"> |