Difference between revisions of "Last Command"

From GeoGebra Manual
Jump to: navigation, search
m (Text replace - "<div class="box info"> 48px|left This page is part of the official manual for print and pdf. For structural reasons normal users can't edit this page. If you found any errors on this page please contact )
(command syntax: changed [ ] into ( ))
 
(6 intermediate revisions by 3 users not shown)
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 L> ]
+
:Gives a new list that contains the last element of the initial list.
:Gives a new list that contains the last element of the list ''L''.
+
:{{example|1=<div><code><nowiki>Last({1, 4, 3})</nowiki></code> yields ''{3}''.</div>}}
:{{example|1=<div><code><nowiki>Last[{1, 4, 3}]</nowiki></code> yields ''{3}''.</div>}}
+
:{{note| 1=To get the last element use <code><nowiki>Element({1, 4, 3}, 3)</nowiki></code>.}}
:{{note| 1=To get the last element use <code><nowiki>Element[{1, 4, 3}, 3]</nowiki></code>.}}
+
;Last( <List>, <Number of elements> )
;Last[ <List L>, <Number n of elements> ]
+
:Gives a new list that contains just the last ''n'' elements of the initial list.
:Gives a new list that contains just the last ''n'' elements of the list ''L''.
+
:{{example|1=<div><code><nowiki>Last({1, 4, 3}, 2)</nowiki></code> yields ''{4, 3}''.</div>}}
:{{example|1=<div><code><nowiki>Last[{1, 4, 3}, 2]</nowiki></code> yields ''{4, 3}''.</div>}}
+
;Last( <Text> )
;Last[ <Text> ]
 
 
:Gives last character of the text.
 
:Gives last character of the text.
:{{example|1=<div><code><nowiki>Last["Hello"]</nowiki></code> yields ''"o"''.</div>}}
+
:{{example|1=<div><code><nowiki>Last("Hello")</nowiki></code> yields ''"o"''.</div>}}
;Last[ <Text> , <Number n of elements> ]
+
;Last( <Text> , <Number of elements> )
 
:Gives the last ''n'' characters of the text.
 
:Gives the last ''n'' characters of the text.
:{{example|1=<div><code><nowiki>Last["Hello",2]</nowiki></code> yields ''"lo"''.</div>}}
+
:{{example|1=<div><code><nowiki>Last("Hello", 2)</nowiki></code> yields ''"lo"''.</div>}}
==CAS Syntax==
+
 
;Last[ <List L> ]
 
:Gives a new list that contains the last element of the list ''L''.
 
:{{example|1=<div><code><nowiki>Last[{1, 4, 3}]</nowiki></code> yields ''{3}''.</div>}}
 
:{{note| 1=To get the last element use <code><nowiki>Element[{1, 4, 3}, 3]</nowiki></code>.}}
 
;Last[ <List L>, <Number n of elements> ]
 
:Gives a new list that contains just the last ''n'' elements of the list ''L''.
 
:{{example|1=<div><code><nowiki>Last[{1, 4, 3}, 2]</nowiki></code> yields ''{4, 3}''.</div>}}
 
 
{{note| 1=<div>See also [[First Command]].</div>}}
 
{{note| 1=<div>See also [[First Command]].</div>}}

Latest revision as of 10:22, 6 October 2017


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".


Note:
See also First Command.
© 2024 International GeoGebra Institute