using UnityEngine;

using System.Collections;


public class chap10_10 : MonoBehaviour {


// Use this for initialization

void Start () {

Hashtable ht = new Hashtable();

string text = "2014    Asian Game 2014 World Cup " + " 2014 LOL Game Asian Cup";

char[] sep = {' ','.'} ;

string[] tokens = text.Split(sep, System.StringSplitOptions.RemoveEmptyEntries); // System.StringSplitOptions.RemoveEmptyEntries-> empty.null

foreach(string t in tokens){

//print (t);

if(ht.ContainsKey(t))

ht[t] = (int)ht[t] + 1;

else

ht[t] = 1;

}

foreach(DictionaryEntry e in ht)

{

print ("Word = " + e.Key + "  count =" + e.Value);

}

}

// Update is called once per frame

void Update () {

}

}




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

상태 이상시 잘쓰는 비트 연산  (0) 2014.05.20
Item  (0) 2014.05.20
해쉬 테이블 -> 어레이 리스트  (0) 2014.05.20
큐를 이용한 총알 놀이 invoke sendmessage transform  (0) 2014.05.20
해석중  (0) 2014.05.20

+ Recent posts