Java is taken in bytes to intercept String strings.

xiaoxiao2021-03-06  44

/ **

* Take the former Tocount characters of strings

*

* @Param STR is processed strings

* @Param Tocount interception length

* @Param more suffix string

* @version 2004.11.24

* @Author zhulx

* @Return String

* /

Public Static String Substring (String Str, Int Tocount, String More)

{

INT reint = 0;

String restr = "";

IF (str == NULL)

""; "

Char [] tempchar = str.tochararray ();

For (int KK = 0; (KK Reint); KK ) {

String S1 = Str.Valueof (Tempchar [KK]);

BYTE [] B = S1.GetBytes ();

Reint = B.LENGTH;

Restr = Tempchar [KK];

}

IF (TOCOUNT == Reint || (TOCOUNT == Reint - 1)))

RESTR = More;

Return RESTR;

}

转载请注明原文地址:https://www.9cbs.com/read-47600.html

New Post(0)