hello99hello
Programmer
Hello All
I have the string below:
Red Cross, CPR – life support, completed
I have managed to put the string in an array separated by comma.
My goal is to do three things:
1)use the default value in third element of the array, else use “completed”
if ($array[0] eq ?)
else $array[0] = “completed”;
2)merge second and third elements into first element so that it reads:Red Cross – CPR Support – completed
$array[0] = $array[0] . “-“ $array[1]. “-“ $array[2]
3)Remove the last two elements after merging:
chop(@array);
chop (@array);
However, this is not working, any input would be greatly appreciated.
I have the string below:
Red Cross, CPR – life support, completed
I have managed to put the string in an array separated by comma.
My goal is to do three things:
1)use the default value in third element of the array, else use “completed”
if ($array[0] eq ?)
else $array[0] = “completed”;
2)merge second and third elements into first element so that it reads:Red Cross – CPR Support – completed
$array[0] = $array[0] . “-“ $array[1]. “-“ $array[2]
3)Remove the last two elements after merging:
chop(@array);
chop (@array);
However, this is not working, any input would be greatly appreciated.