This function is nothing special, that is, it can take a range of strings that can be intercepted. Maybe small feature is that Len is byte, solving the Chinese characters and English bytes. Different lengths are different.
#Region string intercept function public static string cutstring (string infutstring, int LEN) {
Asciiencoding ascii = new asciiencoding (); int Templen = 0; string tempstring = ""; byte [] s = ascii.getbytes (InputString); for (int i = 0; i
If (Templen> Len) Break;} // If you cut, add half a omitted number byte [] mybyte = system.text.encoding.default.getBytes (InputString); if (mybyte.length> len) Tempstring = "... "
Return Tempstring;} #ENDREGION