Difference between revisions of "Last Command"

From GeoGebra Manual
Jump to: navigation, search
Line 9: Line 9:
 
{{Example|1=<code>Last["Hello",2]</code> returns "lo".}}
 
{{Example|1=<code>Last["Hello",2]</code> returns "lo".}}
 
==CAS Syntax==
 
==CAS Syntax==
 +
; Last[List L]: Returns list containing the last element of the list L.
 +
{{Example|1=<code>Last[{1,2,3}]</code> returns {3}.}}
 +
To get the last element itself use e.g. [[Element Command]].
 +
; Last[List L, Number n of Elements]: Returns a list containing just the last ''n'' elements of the list L.

Revision as of 12:00, 8 August 2011


Last[List L]
Returns list containing the last element of the list L.
Example: Last[{1,2,3}] returns {3}.

To get the last element itself use e.g. Element Command.

Last[List L, Number n of Elements]
Returns a list containing just the last n elements of the list L.
Last[Text]
Returns last character of the text.
Last[Text, Number n of Elements]
Returns the last n characters of the text.
Example: Last["Hello",2] returns "lo".

CAS Syntax

Last[List L]
Returns list containing the last element of the list L.
Example: Last[{1,2,3}] returns {3}.

To get the last element itself use e.g. Element Command.

Last[List L, Number n of Elements]
Returns a list containing just the last n elements of the list L.
© 2021 International GeoGebra Institute