Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Spiski : MonoBehaviour
- {
- List<string> friends = new List<string>();
- void Start()
- {
- friends.Add("Ваня");
- friends.Add("Маша");
- friends.Add("Артем");
- friends.Add("Таня");
- print(friends);
- //System.Collections.Generic.List`1[System.String]
- print(friends[0]); //Ваня
- print(friends[3]); //Таня
- print(friends[4]); //ArgumentOutOfRangeException: Index was out of range.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment