How to convert String array to int array

Hi friends, I’m asking this question after searching this forum for similar problems but they are not helpful for me. I am creating a card game. I’ve created string array of cards player has >

var playerCards : Array = ["playerCard1", "playerCard2", "playerCard3", "playerCard4", "playerCard5", "playerCard6", "playerCard7", "playerCard8", "playerCard9", "playerCard10"];

While playing game, the player will select one of these cards. I want that card to give/ display its index in array, so that I can compare it with another card and see whether they match or not like this >

if (playerCardID == enemyCardID)
{
	Debug.Log ("CARDS MATCHED!!!");
}

I need indexes of playerCardID only, those of enemyCardID will be generated randomly.
SO what is the solution for this one. can you help plz. Thanx

You can create a function that find the index of a string in the array by comparing it with each members. Might not be very optimized, not to the point to slow down your game but still. You could use a dictionary as well, but I suppose it would be the same.

You could create a class containing the name and the index, then do an array of that instead.