s_name=s_title.Length>8?s_title.Substring(0,6)+"...":s_title;s_title是你字符串的内容

解决方案 »

  1.   

    <table><tr><td>test this forum </td></tr></table>
      

  2.   

    If strValue.Length > 100 Then
         strValue = Left(strValue, 100) & "......"
     End If
      

  3.   

    如果你需要它显示的长度很规范就不好判断了,你可以显示一下a和b的Length
    string a = "一二三四五";
    string b = "0123456789";
      

  4.   

    由于汉字与字母的长度是不一样的,1汉字=2字母.
    如果是粗略的判断
    if(str.Length > 100)
    {
        str = str.SubString(0,100)+"..."
    }
      

  5.   

    string ss=rs["字段名"].ToString;
    string bb;
    if(ss.Length>=100)
    {
    bb=ss.Substring(0,100)+"....";
    }
    else
    {
    bb=ss;
    }
      

  6.   

    if(ss.Length>=100)
    {
    bb=ss.Substring(0,100)+"....";
    }
      

  7.   

    疯了?!.net里面字符串中英文占的长度是相等的!!