How to replace text in a string

后端 未结 2 1107
暖寄归人
暖寄归人 2021-01-24 01:51

This is my code, I want to replace the word \"here\" with \"potato\" in the simplest way.

Private Sub btnreplace_Click(ByVal sender As System.Object, ByVal e As          


        
2条回答
  •  独厮守ぢ
    2021-01-24 02:18

    since its a particular word you can use simple text replacement other than using regex.replace()

    try this

    txttyping.Text = Replace(txttyping.Text, "here", "potato")
    

    here replace(sourcestring,findword,replaceword)

提交回复
热议问题