The .Replace() method is on System.String. There is one in
Microsoft.VisualBasic, but don't use it. Use the one on the String object.
In other words, every string has that method available:
Dim a As System.String = "a string with stuff in it"
Trace.Write(a.Replace("with", "WITH"))
' you get:
' a string WITH stuff in it
Don't forget the RegExp class also.
David L. Penton, Microsoft MVP
JCPenney Application Specialist / Lead
"Mathematics is music for the mind, and Music is Mathematics for the
Soul. - J.S. Bach"
[EMAIL PROTECTED]
Do you have the VBScript Docs or SQL BOL installed? If not, why not?
VBScript Docs: http://www.davidpenton.com/vbscript
SQL BOL: http://www.davidpenton.com/sqlbol
-----Original Message-----
From: Falls, Travis D (CASD, IT) [mailto:[EMAIL PROTECTED]]
Well, for one I am having a hard time finding where to look fro
documentation on the classes and methods. I know VB has a relpace()
function, but I don't know what class has it. I can't seem to figure out
how to use VS.net, and I am so use to using JBuilder, and I use the "."
operators to show me the methods. so I guess I am having trouble finding
out how to learn the api. Any thoughts matt?
Regards,
Travis D. Falls
-----Original Message-----
From: Matthew Small [mailto:[EMAIL PROTECTED]]
What kinds of problems are you having?
Matthew Small
IT Supervisor
Showstopper National Dance Competitions
3660 Old Kings Hwy
Murrells Inlet, SC 29576
843-357-1847
http://www.showstopperonline.com
-----Original Message-----
From: Falls, Travis D (CASD, IT) [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 08, 2002 8:25 PM
To: ActiveServerPages
Subject: ASP.NET
does anyone know what the most efficient way to read in a file, search
it
and then replace a key word with the contents of another file? I want
to
create a wrapper, read it in search it for ~~REPLACE THIS~~ when I find
it
replace it with the contents from another file. here is my code so far
but
I am stuck and haven't found much on the web.
<%@ Import Namespace="System.IO" %>
<script language="vb" runat="server">
sub Page_Load(sender as Object, e as EventArgs)
Dim FILENAME as String = Server.MapPath("../template20020826.htm")
Dim objStreamReader as StreamReader
Dim contents as String
Dim tester as boolean
tester = true
objStreamReader = File.OpenText(FILENAME)
Do While tester = true
contents= objStreamReader.ReadLine()
if(contents = "~~Replace This~~") Then
Dim FILENAME2 as String =
Server.MapPath("../travis.htm")
Dim objStreamReader2 as StreamReader
objStreamReader2 = File.OpenText(FILENAME2)
Dim innerContents as String = objStreamReader2.ReadToEnd()
contents = contents & innerContents
end if
if (contents = "") Then Exit Do
Loop
Output.Text = contents
objStreamReader.Close()
end sub
</script>
<asp:label runat="server" id="Output" />
---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]