Nissa Armelon
Nissa Armelon

Reputation: 111

how to modify an array value with given index?

I want to modify an array cell, which I can do when I know the cell as a number. However here my cell position is given by $i.

pomme[`${i}`]=""

I tried without the `` and it doesn't work either?

How am I suppose to do it?

Upvotes: 0

Views: 125

Answers (1)

Mureinik
Mureinik

Reputation: 311798

You don't need the quotes. Just use ${i}, or even $i:

pomme[${i}]=""

Or

pomme[$i]=""

Upvotes: 1

Related Questions