截取32 个字节

'作废
Public Function GetDealWithStr(strInit As String) As String
'**************************************************************************
'功 能:对字符串进行处理 长度>17 的在17位置加上换行符 反之 不进行处理
'传入参数:要处理的字符串
'返回参数:处理后的字符串
'作 者: qieqian
'日 期:2016-5-12
'**************************************************************************
On Error GoTo err
Dim i As Long
Dim length As Long
Dim StrOperation As String

length = 0
StrOperation = ""

For i = 1 To Len(strInit)

If (Asc(Mid(strInit, i, 1)) < 0) Then
length = length + 2
Else
length = length + 1
End If

If length > 34 Then
length = 0
StrOperation = StrOperation & Space(1) & vbCrLf & Mid(strInit, i, 1)
Else
StrOperation = StrOperation & Mid(strInit, i, 1)
End If

Next i

GetDealWithStr = StrOperation
Exit Function
err:
MsgBox err.Number & err.Description
End Function

posted @ 2016-05-13 15:37  圣诞节到了  阅读(214)  评论(0编辑  收藏  举报