Parse string

huhhuhhuh

Active member
Joined
Feb 28, 2006
Messages
42
Programming Experience
Beginner
VB.NET:
Dim strRetPage As [String] = Nothing
strRetPage = strRetPage + Encoding.ASCII.GetString(buffbyte, 0, rBytes)
While rBytes > 0
rBytes = IPsocket.Receive(buffbyte, buffbyte.Length, 0)
strRetPage = strRetPage + Encoding.ASCII.GetString(buffbyte, 0, rBytes)
End While
IPsocket.Shutdown(SocketShutdown.Both)
IPsocket.Close()
Dim strreplace As String = "blahblah"
strRetPage.ToString()
If conf(1) = 1 Then
For i As Integer = 0 To maxwordcount - 1
strRetPage.Replace(keywords(i), strreplace)
Console.WriteLine("word replaced")
Next
End If
Dim strretpage2 As [String] = strRetPage

I'm trying to replace all words of value contained in keyword(i) array with "blahblah" but it doesn't seem to be working. Any help regarding this matter or how to parse through a string for an instance of a word would be appreciated
 
String.Replace is a function method that returns a new string after the method has done its work, so you have to catch the return like any other function method call.
VB.NET:
[COLOR=red]strRetPage =[/COLOR] strRetPage.Replace(keywords(i), strreplace)
 
Back
Top