string.Split( new char[]{'?'} ) 和 string.Split( '?' )

Tommy8251 2005-10-29 09:38:24
初到这里:
1.string.Split( new char[]{'?'} ) 和 string.Split( '?' )请问这个有何不同?

2.<headCode><![CDATA[<script type="text/javascript">Flash_IMG("Images/banner.swf",468,80);</script>]]></headCode> 中的 CDATA是什么意思?

3.<SendTo>~/ContentList.aspx?ClassID=$1</SendTo> 中的符号 ~ 是何解

以上三个问题一直没能找到答案.那位能帮助一下
...全文
226 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
uumlwy 2005-10-29
  • 打赏
  • 举报
回复
using System;

public class StringSplit2 {
public static void Main() {

string delimStr = " ,.:";
char [] delimiter = delimStr.ToCharArray();
string words = "one two,three:four.";
string [] split = null;

Console.WriteLine("The delimiters are -{0}-", delimStr);
for (int x = 1; x <= 5; x++) {
split = words.Split(delimiter, x);
Console.WriteLine("\ncount = {0,2} ..............", x);
foreach (string s in split) {
Console.WriteLine("-{0}-", s);
}
}
}
}
Ivony 2005-10-29
  • 打赏
  • 举报
回复
1、结果没有不同
2、<[CDATA[......]]>表示里面的内容不使用HTML转义,也就是说&就是&,而不用写成&空格也不用写成 。
3、因为不知道你是从哪里摘出来的,所以我只能猜测,~代表当前虚拟路径。

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧