15、Response
Response.Write("字串");
Response.Write(变量);
向页面输出。
Response.Redirect("URL地址");
跳转到URL指定的页面
16、char.IsWhiteSpce(字串变量,位数)——逻辑型
查指定位置是否空字符;
如:
string str="中国 人民";
Response.Write(char.IsWhiteSpace(str,2)); //结果为:True, 第一个字符是0位,2是第三个字符。
17、char.IsPunctuation(’字符’) --逻辑型
查字符是否是标点符号
如:Response.Write(char.IsPunctuation(’A’)); //返回:False
18、(int)’字符’
把字符转为数字,查代码点,注意是单引号。
如:
Response.Write((int)’中’); //结果为中字的代码:20013
19、(char)代码
把数字转为字符,查代码代表的字符。
如:
Response.Write((char)22269); //返回“国”字。
20、 Trim()
清除字串前后空格
21 、字串变量.Replace("子字串","替换为")
字串替换
如:
string str="中国";
str=str.Replace("国","央"); //将国字换为央字
Response.Write(str); //输出结果为“中央”
<>