CopyCode The Code is as follows :**////
/// Intercept a string without specifying the length of the string
///
/// String to be truncated
/// The length of each line, more than the length of this line automatically wrap
///
Public String cutstr (string STR, int Len)
{String S = "";
For (INT I = 0; I 11 {
Int r = I % Len;
Int last = (Str. Length/Len) * Len;
If (I! = 0 & I <= last)
{
If (r = 0)
{
S + = Str. substring (I-Len, Len) +"
";
}
}
Else if (I> last)
{
S + = Str. substring (I-1 );
Break;
}
}
Return S;
}
/**////
/// Intercept the string and limit the length of the string, more than the given length +...
///
/// String to be truncated
/// The length of each line, more than the length of this line automatically wrap
/// Maximum length of the output string
///
Public String cutstr (string STR, int Len, int max)
{
String S = "";
String Sheng = "";
If (Str. length> MAX)
{
STR = Str. substring (0, max );
Sheng = "";
}
For (INT I = 0; I 53 {
Int r = I % Len;
Int last = (Str. Length/Len) * Len;
If (I! = 0 & I <= last)
{
If (r = 0)
{
S + = Str. substring (I-Len, Len) +"
";
}
}
Else if (I> last)
{
S + = Str. substring (I-1 );
Break;
}
}
Return S + Sheng;
}