string.Substring,string.Concat的用法

string.Concat:

参数 

arg0

Object 或 空引用(在 Visual Basic 中为 Nothing)。


返回值 
arg0 的值的 String 表示形式。

如 string.Concat("a","b","c","d") 的值是 "abcd",作用是连接字符串.

string.Substring
String.Substring (Int32)

从此实例检索子字符串。子字符串从指定的字符位置开始。

如:

string str = "abcdefg";

str = str.Substring(3);

str的结果是"efg";

因为字符串索引从0开始,3其实是第四个字符.

String.Substring (Int32, Int32)

从此实例检索子字符串。子字符串从指定的字符位置开始且具有指定的长度。

string str = "abcdefg";

str = str.Substring(3,1);

str 的值是"e",从第四位开始截取1长度.


posted @ 2011-02-18 17:26  spring yang  阅读(1275)  评论(0编辑  收藏  举报