•19:29
public string GetSubstring(string ostr, int n)
{
if (ostr.Length <= n) //如果ostr长度小于n,返回ostr
return ostr;
else
{
return ostr.Substring(0, n) + "…";
}
}
{
if (ostr.Length <= n) //如果ostr长度小于n,返回ostr
return ostr;
else
{
return ostr.Substring(0, n) + "…";
}
}
.Net
|

0 评论: