jwbf.net
当前位置:首页 >> vB中找出句子中最长单词,怎么出错了,提示无效的... >>

vB中找出句子中最长单词,怎么出错了,提示无效的...

这样: Private Sub Command1_Click() Text2 = maxword(Text1) End Sub Function maxword(s) As String Dim mw As Long, i As Integer Dim word() As String word = Split(s, " ") For i = 0 To UBound(word) If Len(word(i)) > mw Then mw = Le...

Private Sub Command1_Click() Dim Word() As String, LongestWord As String, LongestWordLength As Integer Word = Split(Left(Text1.Text, Len(Text1.Text) - 1), " ") LongestWordLength = 0 For i = LBound(Word) To UBound(Word) If Len(W...

参考示例: Dim strSentence As String, strTemp As String, strWord() As StringDim i As Integer' 大写转小写,去掉前后两端空格和回车符strTemp = Trim(Replace(LCase(Text1.Text), vbCrLf, ""))' 去掉非英文、空格的字符For i = 0 To Len(st...

Private Sub Command1_Click() If Text1.Text = "" Then Exit Sub Dim word As Variant, s As String Dim k As Integer, maxw As String, n As Integer s = Replace(Replace(Text1.Text, ",", " "), ".", " ") s = Replace(Replace(s, ",", " "...

Private Sub Command1_Click() Dim s As String, s1 As String, sm As String Dim L As Integer s = Text1.Text For i = 1 To Len(s) If Mid(s, i, 1) " " Then s1 = s1 & Mid(s, i, 1) Else If Len(s1) > Len(sm) Then sm = s1 s1 = "" End If ...

Private Sub Command1_Click()Dim a() As Stringa = Split(Text1.Text, " ")Text2.Text = UBound(a) + 1End Sub细节自已调整。。。

'不用这么复杂,你的代码太长没有看,如果一定用你的代码,我再给你修改一下 Option Explicit Private Sub Command1_Click() Dim i As Long, arr, n As Long If InStr(Text1, " ") > 0 Then arr = Split(Text1) For i = 0 To UBound(arr) If Trim...

dim ss as string dim lstr as string lstr=text1.text if right(lstr,1)="." then lstr=left(lstr,len(lstr)-1) end if ss=lword(lstr) text2.text=ss text3.text=len(ss)

你去找一个批量合并文本的软件。看起来像个小剪刀的。然后直接把多个EXCEL合并。 或者下载一个WPS,然后倒入,就可以把N个EXCEL文件导入到一个文件。微软的EXCEL行数有限,最多到六千行,WPS可以到几百万。 其实导入到WORD中效果也一样的,然后...

控件:1个文本框,1个按钮 代码: Private Sub Command1_Click()a = Len(Text1.Text)b = 0For i = 1 To a If " " = Mid(Text1.Text, i, 1) Then b = b + 1 '统计空格数 End If If "," = Mid(Text1.Text, i, 1) Or "." = Mid(Text1.Text, i, 1) T...

网站首页 | 网站地图
All rights reserved Powered by www.jwbf.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com