Question : Insert string into String at known value vb.net

Hi,
I have a very large string, containing a lot of HTML code which I need to insert a new paragraph block after the body tag.

I have a function like,  m = body(split,"<body>)

x = m(0), however it only returns the next part of the line, not the entire block of lines.
I think the split is only looking until the next vbclr.

Is there another way to find the BODY tag and insert a new line?

VB.net

Steve

Answer : Insert string into String at known value vb.net

This will insert
newtext
after your body tag.
1:
2:
3:
4:
5:
        Dim fName As String = "C:\Users\shadow\Documents\ExpertsExchange\EmailContent.txt"
        Dim oldString As String = My.Computer.FileSystem.ReadAllText(fName)
        Dim findStr As String = "<body lang=""EN-US"" xml:lang=""EN-US"">"
        Dim newString As String = Replace(oldString, findStr, findStr + vbCrLf + "newtext")
        MsgBox(newString)
Random Solutions  
 
programming4us programming4us