且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

实现索引和QUOT;运营商QUOT;在一类在C#

更新时间:2023-02-15 20:52:28

下面是使用字典作为存储为例:

Here is an example using a dictionary as storage:

public class Foo {

	private Dictionary<string, string> _items;

	public Foo() {
		_items = new Dictionary<string, string>();
	}

	public string this[string key] {
		get {
			return _items[key];
		}
		set {
			_items[key]=value;
		}
	}

}