例:
山东、河南、河北、北京
这么一句话,中间用顿号分开,加下划线,线与字体不能同色。我要选择"北京",点击"北就"就把"北京"选出来,其他的删除。

解决方案 »

  1.   

    你说的效果,不能用普通的办法..有个取巧的办法..你参考下:把需要添加下划线的字体,用div标签包起来..给div标签加入CSS样式,只定义一个bottom border的线条//
      

  2.   

    style='COLOR: #366; BORDER-BOTTOM: #f90 1px solid;'
      

  3.   

    string temp="";
    string str="山东、河南、河北、北京";
    string[] outstr=str.Split('、');
    for(int i=0;i<outstr.Length;i++)
    {
    outstr[i]="<a style='COLOR: #366; BORDER-BOTTOM: #f90 1px solid;' onclick=javascript:document.all.hdiv.innerHTML='"+outstr[i]+"'>"+outstr[i].Trim()+"</a>";
    temp+=outstr[i];
    if(i<outstr.Length-1)
    {
    temp+="、";
    }
    }
    this.Label1.Text="<div id='hdiv'>"+temp+"</div>";