lrange - Online Linux Manual PageSection : n
Updated : 7.4
Source : Tcl
Note : Tcl Built-In Commands


NAMElrange − Return one or more adjacent elements from a list

SYNOPSISlrange list first last .\}

DESCRIPTIONList must be a valid Tcl list. This command will return a new list consisting of elements first through last, inclusive. The index values first and last are interpreted the same as index values for the command string index, supporting simple index arithmetic and indices relative to the end of the list. If first is less than zero, it is treated as if it were zero. If last is greater than or equal to the number of elements in the list, then it is treated as if it were end. If first is greater than last then an empty string is returned. Note: lrange list first first does not always produce the same result as lindex list first (although it often does for simple fields that are not enclosed in braces); it does, however, produce exactly the same results as list [lindex list first]

EXAMPLESSelecting the first two elements: % lrange {a b c d e} 0 1 a b Selecting the last three elements: % lrange {a b c d e} end-2 end c d e Selecting everything except the first and last element: % lrange {a b c d e} 1 end-1 b c d Selecting a single element with lrange is not the same as doing so with lindex: % set var {some {elements to} select} some {elements to} select % lindex $var 1 elements to % lrange $var 1 1 {elements to}

SEE ALSOlist(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), lset(n), lreplace(n), lsort(n), string(n)

KEYWORDSelement, list, range, sublist
0
Johanes Gumabo
Data Size   :   9,919 byte
man-lrange.nBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   4 / 202,267
Visitor ID   :     :  
Visitor IP   :   3.144.119.149   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (rof_escape_sequence_block|26|(null)|(null)|-1|141)         (parse_manual_page_|249|lrange.n|283/141|══─}─══|.══─}─══ )         (htmlprn|149|lrange.n|283/141|.══─}─══|.══─}─══ )         (rof_escape_sequence|91|lrange.n|283/142|\}|.\} )         (parse_manual_page_|249|lrange.n|283/142|\}|.\} )