#region 擷取字串
/// <summary>
/// 擷取字串
/// </summary>
/// <param name=”strWord”></param>
/// <returns></returns>
private string GetFitString(string strWord)
{
if(strWord.Length>20)
{
return strWord.Substring(0,20);
}
else
{
return strWord;
}
}
#endregion
#region 擷取字串
/// <summary>
/// 擷取字串
/// </summary>
/// <param name=”strWord”>要判斷的字串</param>
/// <param name=”Words”>希望字數</param>
/// <returns></returns>
private string GetFitString(string strWord,int Words)
{
if(strWord.Length>Words)
{
return strWord.Substring(0,Words);
}
else
{
return strWord;
}
}
#endregion
#region 擷取字串
/// <summary>
/// 擷取字串
/// </summary>
/// <param name=”strWord”>要判斷的字串</param>
/// <param name=”Words”>希望字數</param>
/// <param name=”strAdd”>最後尾巴要加上的字</param>
/// <returns></returns>
private string GetFitString(string strWord,int Words,string strAdd)
{
if(strWord.Length>Words)
{
return strWord.Substring(0,Words)+strAdd;
}
else
{
return strWord;
}
}
#endregion
留言列表