#region 字符串截取函数
public static string CharSubstring(string inputString, int startposition ,int len)
{
if (startposition < 0) return "";
int i = 0;
int c1 = 0;
int c2 = 0;
byte[] s = System.Text.Encoding.Default.GetBytes(inputString);
if (s.Length <= startposition) return "";
if (s.Length < startposition + len) len = s.Length - startposition; //避免下标超界
for (i =0 ;i <startposition; i++)
if ( (int)s[i]>=128) c1++;
c1 /= 2;
for ( i = startposition ; i < startposition+len; i++)
if ((int)s[i] >= 128) c2++;
c2 /= 2;
return inputString.Substring(startposition-c1,len-c2);
}
#endregion