Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


How To Replace Double Quotes w Sngle Quotes in str

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,39
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> How To Replace Double Quotes w Sngle Quotes in str
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 How To Replace Double Quotes w Sngle Quotes in str - 5/23/2001 7:52:23 AM   
  mstargas

 

Posts: 6
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
Hi,

I need help replacing my double quotes of my log file with single quotes. I've heard there's two ways to do this: 1) By using the RegExp Object, and 2) simply using the Replace() function.

I haven't had any luck using the RegExp object, because I can't create a new instance of the object.

Can someone check out my code and advise.


<html><head><title></title></head>
<body>
<%


Dim str ' some string that needs to have certain words
' replaced with other words
str="10.11.130.80 - - [01/May/2001:13:52:59 -0600] "GET /insuredacct/index.cfm HTTP/1.0" 200 355 "

Dim objRegExp
Set objRegExp = New RegExp

objRegExp.IgnoreCase = True
objRegExp.Global = True

'Replace all instances of Apache with IIS
objRegExp.Pattern = "\bApache\b"
str = objRegExp.Replace(str, "IIS")

'Repalce all instances of Perl with ASP
objRegExp.Pattern = "\bPerl\b"
str = objRegExp.Replace(str, "ASP")

Set objRegExp = Nothing 'Clean up!

response.write str

%>

</body>
</html>


I just want a ' every where there's a ".
 
 
Post #: 1
 
 Re: How To Replace Double Quotes w Sngle Quotes in str - 5/23/2001 7:54:01 AM   
  adminkoe

 

Posts: 117
Score: 0
Joined: 12/23/2000
From:
Status: offline
will replace any " with a ' in the string, 'str'

(in reply to mstargas)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> How To Replace Double Quotes w Sngle Quotes in str Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts