c#
文章平均质量分 67
allen_row
正在路上走
展开
-
C#中Trim的使用
trim(); void DelSpace() { string strWithSpace = " this is a string with space "; string strWithoutSpace = strWithSpace.Trim(); Console.W原创 2008-04-18 16:34:00 · 2999 阅读 · 0 评论 -
const 和 readonly 的比较
readonly:表示只读域 const:表示常量const特性: 1:必须在声明的初始化 2:用const声明的常量不能从一个变量中取值来初始化。 3:常量是静态的(隐式静态),不需要用static来修饰。 readonly和const的一些区别 readonly可是是静态的也可以是非静态的。 readonly不能是枚举类型 readonly字原创 2008-07-29 13:47:00 · 278 阅读 · 0 评论 -
for 循环,foreach循环
在C#中,对于循环的处理有了一种新的方式,就是foreach循环。它和for循环有相似之处,也有自己的区别。两者都可以遍历一个数组。 例如我们有一个string数组 myArray 在使用for循环来访问这个数组的时候,语法是 for (int i = 0; i { //code h原创 2008-10-07 16:12:00 · 734 阅读 · 0 评论