// Use this for initialization void Start() { // CQuickSort.test_sort(); // CQuickSort.test_find(); // CQuickSort.test_search_insert(); // DictionaryInt<string>.test(); DictionaryStr <string> .test(); }
public static void test() { DictionaryStr <string> dic_str = new DictionaryStr <string>(); dic_str.Add("1", "ok1"); dic_str.Add("10", "ok10"); dic_str.Add("100", "ok100"); string v = dic_str["1"]; Debug.LogError("v " + v); v = dic_str["10"]; Debug.LogError("v " + v); v = dic_str["100"]; Debug.LogError("v " + v); bool isexist = dic_str.ContainsKey("1"); Debug.LogError("isexist " + isexist); isexist = dic_str.ContainsKey("2"); Debug.LogError("isexist " + isexist); isexist = dic_str.ContainsKey("100"); Debug.LogError("isexist " + isexist); bool is_remove = dic_str.Remove("10"); Debug.LogError("is remove " + is_remove); isexist = dic_str.ContainsKey("10"); Debug.LogError("isexist " + isexist); dic_str["99"] = "ok99"; Debug.LogError(dic_str["99"]); }