1、找一份詞庫(kù)

成都創(chuàng)新互聯(lián)公司長(zhǎng)期為數(shù)千家客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊(duì)從業(yè)經(jīng)驗(yàn)10年,關(guān)注不同地域、不同群體,并針對(duì)不同對(duì)象提供差異化的產(chǎn)品和服務(wù);打造開(kāi)放共贏平臺(tái),與合作伙伴共同營(yíng)造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為梅縣企業(yè)提供專業(yè)的網(wǎng)站設(shè)計(jì)制作、成都做網(wǎng)站,梅縣網(wǎng)站改版等技術(shù)服務(wù)。擁有10余年豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制開(kāi)發(fā)。
2、在“文中”進(jìn)行分詞、匹配
.net和java都有比較成熟的分詞和詞庫(kù),vb實(shí)現(xiàn)比較費(fèi)時(shí)
Dim number As Long
Private Function FindStr(ByVal SLeft As Long, ByVal SFind As String, ByVal SSFind As String)
If Len(SFind) Len(SSFind) - SLeft Then
FindStr = -1
Exit Function
Else
FindStr = InStr(SLeft + 1, SSFind, SFind) - 1
End If
End Function
Private Sub Command1_Click()
number = FindStr(0, Text1.Text, RichTextBox1.Text)
If number = -1 Then
MsgBox "沒(méi)有找到"
Command2.Enabled = False
Else
RichTextBox1.SelStart = number
RichTextBox1.SelLength = Len(Text1.Text)
Command2.Enabled = True
End If
End Sub
Private Sub Command2_Click()
number = FindStr(number + Len(Text1.Text), Text1.Text, RichTextBox1.Text)
If number = -1 Then
MsgBox "查找完畢"
Command2.Enabled = False
Else
RichTextBox1.SelStart = number
RichTextBox1.SelLength = Len(Text1.Text)
Command2.Enabled = True
End If
End Sub
注意RichTextBox1.HideSelection要設(shè)為false
遍歷datagridview的單元格,判斷單元格內(nèi)的值是否與textbox的text相等。
foreach (DataGridViewRow row in dataGridView1.Rows)
{
foreach(DataGridViewCell cell in row)
{
if(cell.value = textbox1.text) then
cell.focus()
else
msg("沒(méi)有找到相關(guān)信息")
}
}
dim str1 ,str2 as string
dim n as integer
str2=inputbox("請(qǐng)輸入要查找的字符:")
for n=1 to len(textbox1.text)
str1=mid(textbox1.text,n,1)
if str2=str1 then
msgbox("找到啦!")
exit for
end if
next
if n=len(textbox1.text)+1 then
msgbox("沒(méi)有你要找的字符!")
end if
網(wǎng)頁(yè)名稱:vb.net查找錯(cuò)字 vb查找字符串位置
當(dāng)前地址:http://www.chinadenli.net/article28/dddgpcp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、軟件開(kāi)發(fā)、、網(wǎng)站制作、商城網(wǎng)站、網(wǎng)站維護(hù)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容