473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Multiple repalace

Hi,

I have a replace function <%= Replace(arData(0,i), "_", " ")%> that works
fine to replace the _ with a space, but I'd also like it to look for, and
replace one word with another in the same string (E,G replace the word
"Right" with "Wrong"). The code is located in a table that is displaying the
results of a database search.

I'm having problems with a) finding out if it's possible to do it this way,
and b) what the syntax should be. I've tried all manner of combinations, but
no luck. Any ideas?

Thanks,

David
Jul 19 '05 #1
5 1242
David wrote on 06 mrt 2004 in microsoft.public.inetserver.asp.general:
I have a replace function <%= Replace(arData(0,i), "_", " ")%> that
works fine to replace the _ with a space, but I'd also like it to look
for, and replace one word with another in the same string (E,G replace
the word "Right" with "Wrong"). The code is located in a table that is
displaying the results of a database search.

<% = Replace(arData(0,i), "Right", "Wrong") %>

preferably do:

<% = Replace(arData(0,i), "Wrong", "Right") %>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
<% = Replace(arData(0,i), "Right", "Wrong") %>

But how do I get this to ALSO change "_"," " in addition to the above?

Thanks


Jul 19 '05 #3
David wrote on 06 mrt 2004 in microsoft.public.inetserver.asp.general:
<% = Replace(arData(0,i), "Right", "Wrong") %>

But how do I get this to ALSO change "_"," " in addition to the above?


<% = Replace(Replace(arData(0,i), "Right", "Wrong"),"_"," ") %>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4
Thanks Evertjan - sorted!
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
David wrote on 06 mrt 2004 in microsoft.public.inetserver.asp.general:
<% = Replace(arData(0,i), "Right", "Wrong") %>

But how do I get this to ALSO change "_"," " in addition to the above?


<% = Replace(Replace(arData(0,i), "Right", "Wrong"),"_"," ") %>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 19 '05 #5
Greetings David:

The replace function replaces words as easy as characters. See example below. This will work in a table as easy as any other string.

<HTML>
<Body>
<%
dim TheWords
TheWords = "Now is the time to change words"
Response.write( "<li>" + TheWords )
TheWords = Replace( TheWords, "time", "age" )
Response.write( "<li>" + TheWords )
%>
</Body>
</HTML>

-rwg
This is what I think, not necessarily what is accurate!

--------------------
| From: "David" <da***@brown6669.freeserve.co.uk>
| Newsgroups: microsoft.public.inetserver.asp.general
| Subject: Multiple repalace
| Lines: 17
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| X-Inktomi-Trace: spr1-pool1-5-0-cust128.cosh.broadband.ntl.com 1078563852 22352 80.5.233.128 (6 Mar 2004 09:04:12 GMT)
| Message-ID: <hu************@newsfep3-gui.server.ntli.net>
| Date: Sat, 6 Mar 2004 09:04:44 -0000
| NNTP-Posting-Host: 80.1.224.5
| X-Complaints-To: ab***@ntlworld.com
| X-Trace: newsfep3-gui.server.ntli.net 1078563853 80.1.224.5 (Sat, 06 Mar 2004 09:04:13 GMT)
| NNTP-Posting-Date: Sat, 06 Mar 2004 09:04:13 GMT
| Organization: ntl News Service
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-online.de!newsfeed.wirehub.nl!
194.168.222.61.MISMATCH!newspeer1-gui.server.ntli.net!ntli.net!newsfep3-gui.server.ntli.net.POSTED!53ab2750!not-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.inetserver.asp.general:267661
| X-Tomcat-NG: microsoft.public.inetserver.asp.general
|
| Hi,
|
| I have a replace function <%= Replace(arData(0,i), "_", " ")%> that works
| fine to replace the _ with a space, but I'd also like it to look for, and
| replace one word with another in the same string (E,G replace the word
| "Right" with "Wrong"). The code is located in a table that is displaying the
| results of a database search.
|
| I'm having problems with a) finding out if it's possible to do it this way,
| and b) what the syntax should be. I've tried all manner of combinations, but
| no luck. Any ideas?
|
| Thanks,
|
| David
|
|
|
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rolf Wester | last post by:
Hi, I have a form with a select element with multiple="true". When using the GET method (I suppose the same happens with the POST method) I can seen that the form sends channels=CH1&channels=CH2...
66
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
11
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g.,...
6
by: Ben Hallert | last post by:
Hi guys, I'm trying to figure out what bone headed mistake I made on something I put together. I've got a form (named 'context') that has a variable number of select-multiple inputs on it. ...
22
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
9
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated...
9
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
4
by: Matt Kruse | last post by:
While developing an internal IE6-only webapp, a discussion started about the 'best' way to apply classes to data tables across multiple pages. The two arguments were: 1. Apply a single class to...
35
by: keerthyragavendran | last post by:
hi i'm downloading a single file using multiple threads... how can i specify a particular range of bytes alone from a single large file... for example say if i need only bytes ranging from...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.