Difference between revisions of "Last Command"

From GeoGebra Manual
Jump to: navigation, search
m
Line 1: Line 1:
<noinclude>{{Manual Page|version=4.2}}</noinclude>
+
<noinclude>{{Manual Page|version=5.0}}</noinclude>
 
{{command|cas=true|list}}
 
{{command|cas=true|list}}
 
;Last[ <List> ]
 
;Last[ <List> ]

Revision as of 13:40, 24 July 2015



Last[ <List> ]
Gives a new list that contains the last element of the initial list.
Example:
Last[{1, 4, 3}] yields {3}.
Note: To get the last element use Element[{1, 4, 3}, 3].
Last[ <List>, <Number of elements> ]
Gives a new list that contains just the last n elements of the initial list.
Example:
Last[{1, 4, 3}, 2] yields {4, 3}.
Last[ <Text> ]
Gives last character of the text.
Example:
Last["Hello"] yields "o".
Last[ <Text> , <Number of elements> ]
Gives the last n characters of the text.
Example:
Last["Hello", 2] yields "lo".

CAS Syntax

Last[ <List> ]
Gives a new list that contains the last element of the initial list.
Example:
Last[{1, 4, 3}] yields {3}.
Note: To get the last element use Element[{1, 4, 3}, 3].
Last[ <List>, <Number of elements> ]
Gives a new list that contains just the last n elements of the initial list.
Example:
Last[{1, 4, 3}, 2] yields {4, 3}.
Note:
See also First Command.
© 2024 International GeoGebra Institute