摘要: 转载的,供自己学习案例是要实现一个对文档文本进行字符处理,并能筛选分离出文档中的单词,且可以以序列索引来对其中的单词进行访问和修改完整代码View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 索引2{ class Program { static void Main(string[] args) { Document mydoc = new Document("Hello,I am a... 阅读全文
posted @ 2012-11-16 17:09 水月小妖 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 转载的问题:为什么c#中要有ref和out?(而java中没有)需求假设:现需要通过一个叫Swap的方法交换a,b两个变量的值。交换前a=1,b=2,断言:交换后a=2,b=1。现编码如下:class Program { static void Main(string[] args) { int a = 1; int b = 2; Console.WriteLine("交换前\ta={0}\tb={1}\t",a,b); Swap(a,b); Console.WriteLine("交换后\ta={0}\tb={1}\t",a,b); Console.Re 阅读全文
posted @ 2012-11-16 14:54 水月小妖 阅读(131) 评论(0) 推荐(0) 编辑