Dim aa As String Dim strRet As String Dim bb As Byte() aa = "截取4字符串abcjdj142你好" bb = Encoding.Default.GetBytes(aa.ToCharArray()) For i As Integer = 0 To aa.Length Step 10 strRet = New String(Encoding.Default.GetChars(bb,0,10)) If aa.IndexOf(strRet) = -1 strRet = New String(Encoding.Default.GetChars(bb,0,9)) End If Output.show(strRet) aa = aa.Replace(strRet,"") bb = Encoding.Default.GetBytes(aa.ToCharArray()) Next Output.show(aa)
|