sealife24
新手上路
- 注册
- 2005-10-23
- 消息
- 107
- 荣誉分数
- 0
- 声望点数
- 0
ask for replace the indicating word of the other indicating word,like:canadian
replace u for all a
result: cunudiun
What;s wrong with the code below?I can't figure it out..please help me,it doesn't work..
Private Sub cmdNewWord_Click()
strWord = txtText.Text
strLetter = txtFindLetter.Text
strReplaceLetter = txtReplaceWith.Text
intLength = Len(strWord)
For intCount = intPosition To intLength
intPosition = InStr(1, strWord, strLetter)
'get the number of the position of the Finding letter
Mid(strWord, intPosition, 1) = strReplaceLetter
'The replace letter will replace the finding word
lblNewWord.Caption = strWord
Next intCount
End Sub
replace u for all a
result: cunudiun
What;s wrong with the code below?I can't figure it out..please help me,it doesn't work..
Private Sub cmdNewWord_Click()
strWord = txtText.Text
strLetter = txtFindLetter.Text
strReplaceLetter = txtReplaceWith.Text
intLength = Len(strWord)
For intCount = intPosition To intLength
intPosition = InStr(1, strWord, strLetter)
'get the number of the position of the Finding letter
Mid(strWord, intPosition, 1) = strReplaceLetter
'The replace letter will replace the finding word
lblNewWord.Caption = strWord
Next intCount
End Sub