การแทนที่คำ ด้วย ฟังก์ชัน Replace

1. Replace() แทนที่คำที่ต้องการ


Syntax
Replace(ByVal Expression As String,ByVal Find As String, ByVal Replacement As String)


Example

ตัวอย่างคำ  Helly gyygle ให้แทน y เป็น 0 จะได้ัดังนี้
 
 Helly gyygle = Hello google

Coding in vb.net

Dim word as String = "Helly gyygle"
Dim str as String = Replace(word , "y", "o")   ' Hello google
Dim str2 as String = word .Replace("y", "o" ' Hello google