About Array or List

Hello everyone so far i was able to do most stuff with out bothering you all but this have me, maybe because im a newb but anyway.

Here it is.

I have an array of strings, lets say like this:

public string[] weapons = {"Weapon1", "Weapon2"}

And i have a string variable asigned

Like this

public string weaponselected = "weapon1";

So what i want to do is the following,

If player press some button the weaponselected string changes to a value stored on the array. I know the input getkey button stuff but how to select a value from the array?

Also, how to add values to the array, say weapon3 or if its already there like weapon2 how to make the input not select weapon2 until someother variable lets say a bool is true?

Hope i made my self clear, english is not my first lenguage, and, im very bad at it i believe XD

I think you should do some Tutorials on basic programming concepts as arrays are very fundamental. There are plenty of resources on the Internet on C# and basic programming concepts.

You can select an individual index in an array by referencing it directly.

myArray[index] = "myWeapon";  // index can be any integer from 0 to 'myArray.length', the max length of the array.

Please go and read some programming tutorials, they will show you in much greater detail how to manipulate arrays.