using UnityEngine;

using System.Collections;


public class chap11_1 : MonoBehaviour {


// Use this for initialization

void Start () {

Hashtable ht = new Hashtable();

ht["Microsoft"] = "www.microsoft.com";

ht["Google"] = "www.google.com";

ht["Naver"] = "www.naver.com";

print (string.Format("url:{0}  {1}",  ht, ht["Microsoft"]));

print (string.Format("url:{0}  {1}", ht, ht["Google"]));

print (string.Format("url{0}  {1}", ht, ht["Naver"]));

foreach(DictionaryEntry e in ht)

{

print ("company : " + e.Key + ", " + " url : "+ e.Value);

}

print(FindURL("Google"));

print(FindURL("Daum"));

}

string FindURL (string company){

if(ht.ContainsKey(company))

return ht[company] as string;

else

return "Not Found";

}

// Update is called once per frame

void Update () {

}

}


'Computer Language > 유니티' 카테고리의 다른 글

남은 시간 출력 하기. 그외 시간 함수  (0) 2014.05.20
프로퍼티  (0) 2014.05.20
상태 이상시 잘쓰는 비트 연산  (0) 2014.05.20
Item  (0) 2014.05.20
문자 짜르기 해쉬 테이블 사용  (0) 2014.05.20

+ Recent posts