Strings arrays in strings array?


I would like to know whether it is possible to build an array of strings in which each string contains a strings array.

For example:

I have an array of strings containing phone numbers and I would like to attach to each phone numbers an array of strings containing the different part of the speech of the called character.

For the moment I have the following variables

var phoneNumNumber : int;
var phoneNumber : String = new String[phoneNumNumber];
var phoneTxt : String = new String[phoneNumNumber];

but with this system I can only attach one string for the text of the called character and I would like to be able to attach more.

Does anybody have an idea? If it is a stupid question, feel free to tell me. I am a beginner and I need to learn.

Thank you.

There are two ways to approach this.

The best would be to use a generic dictionary. See the reference here. A dictionary lets you use one object as a key and the other as a value. In your case you would use the name as the key and the phone number as the value.

The other way would be to build a struct that encapsulates both the name and the other data associated with the name.

In practice its common to use both solutions together.