Hello Monks, i need help. I am trying to get the value of the nth position of a string. Where n = <>.
my £numbers = "2 1 3 4 5"; @numbers = split(' ', £numbers); //I am a beginer, i know this is inef +ficient but it helps me follow my work better. my $input = <>; // say iput is "3" // i want something similar to print $numbers[$input]; // prints 4 as 4 is the "3rd" position in numbers. //basically $numbers[3]; //but what is in [] can be decided by the input of <>
In reply to Nth position of array determind by <> by RuZombieSlayer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |