记录:
在参数前面加this,表示是一个拓展方法pubic void text(this string s) {……}代表为string类中拓展了一个text方法,通过这个类的对象(即实例化)可以调用 如string a = “hello world” a.text();
记录:
在参数前面加this,表示是一个拓展方法pubic void text(this string s) {……}代表为string类中拓展了一个text方法,通过这个类的对象(即实例化)可以调用 如string a = “hello world” a.text();