完整的:- Dim vbstr, fso, vbout, out, vbk, judge
- Set fso = CreateObject("scripting.filesystemobject")
- vbstr = Replace(fso.OpenTextFile("a.txt").ReadAll(), vbCrLf, "")
- judge = "没有"
- For Each out In Split(vbstr, Chr(32))
- vbout = out & vbCrLf & vbout
- For i = 1 To Len(out)
- If InStr(vbk, Mid(out, i, 1)) = 0 Then
- vbk = vbk & Mid(out, i, 1)
- Else
- judge = "有"
- End If
- Next
- Next
- MsgBox "千字文总字数为:" & Len(Replace(vbstr, Chr(32), "")) & "字," & judge & "重复"
- MsgBox vbout, , "倒序输出"
- Set fso = Nothing
复制代码
|