Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PERL

perl slice array

# Basic syntax:
my @array_slice = @your_array[start_index..end_index];

# Example usage:
# Define array
my @your_array = (2.3, 42, 'Word');
# Get 1st - 2nd elements (inclusive, zero-indexed)
my @array_slice = @your_array[1..2];
print "@array_slice
";
--> 42 Word
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #perl #slice #array
ADD COMMENT
Topic
Name
1+3 =