自己做吧
public static string Left(string sSource, int iLength)
{
return sSource.Substring(0, iLength > sSource.Length ? sSource.Length : iLength);
}
public static string Right(string sSource, int iLength)
{
return sSource.Substring(iLength > sSource.Length ? 0 : sSource.Length - iLength);
}
public static string Mid(string sSource, int iStart, int iLength)
{
int iStartPoint = iStart > sSource.Length ? sSource.Length : iStart;
return sSource.Substring(iStartPoint, iStartPoint + iLength > sSource.Length ? sSource.Length - iStartPoint : iLength);
}