a= "I am trying to replace a string from 1 point to another point which is point 2. But I dont know how ? " b = "This"
Now from string a I want to replace from 1 to 2 with string b="this" so the final string will be like c c= "I am trying to replace a string from this. But I dont know how ?
i have the content of a db field output as 'GUEST' on a asp page, i would like to replace it with 'Guest' using the replace function, but im getting kinda lost with the syntax..can anyone help with an example?
I'm executing a stored procedure where I have the values hard-coded. I need to replace the hard-coded values with variables.Here is the hard-coded line:
I need to replace STRATEGY with cmdAlloAmts__alloc_type, AUS with cmdAlloAmts__ddo, and 2005 with cmdAlloAmts__ay. I've made several attempts at replacing the hard-coded values with the variables and come up with different error messages. How can I replace the hard-coded values with variables in the above line?
colleages are creating links in asp sites. however the links are static . is there a way to replace the links with another prefix ?? (on the fly) e.g.
<a href="../../files/abc.zip">some link</a>
is replaced to:
<a href="http://www.domain.com/files/abc.zip">some link</a> and this for all files in the site ? i read something about a replace function but can't use it properly .
All of a sudden this morning my ASP files started generating the error:
Out of String Space: 'Replace'
These script files have been running just fine for several weeks with no problems. I did review the code and yes the script is calling the Replace function at the line specified in the error information.
I'm puzzled as to why the code would all of a sudden start generating this error ?
In the ASP page that is in question, I build a large string (no more than 10K) which is basically an email template in HTML format. Then I replace the parts with the values, which are also strings with the size of 1-2 KB. Code:
I'm going to make a database of rude words, that i do not want users to name themselves when they use my scoreboard. I need my asp to scan their string and if a word from the database appears replace the entire string with anonymous.
I have some code which was designed to astrisk out all but the first and last letter of any appearing rude word
eg: d**n this b****y game or godd**nit
i have changed this to just replace each word to anonymous, but cant get it to the stage above, can any one help? My code so far is below. Code:
I have records from the database for locations as "Baltimore Service center","Vancouver Service center", "Toronto Service center"...etc.I am trying to get a substring where it diaplays just the location and strips Service center ex : Baltimore
If I replace "a" with "b", and then I replace "b" with "a", shouldn't I get the same result? That is what I am trying to encode and decode with Replace() function, but it is giving me different things when I replace and replace again. Here is what I am talking about: Code:
I'm developing an Asp.NET system to take a CSV file uploaded via the web, parse it, and insert the values into an SQL database. My sticking point comes when I try to split() the string returned by readline() on the file.
The following code snippet works for me: tokens = "one,two,three,four".Split(",") for each token in tokens response.write("<td>"+token+"</td>") next
However, if I take the next line in the CSV, read using StreamReader.ReadLine on the PostedFile.InputStream, I receive "Object reference not set to an instance of an object." which I have narrowed down to be my string holding the line. Further investigation reveals that no other string member functions work on my line (.ToCharArray, .ToString, etc).
I suspect that StreamReader.ReadLine is not correctly returning a string, even though Response.Write(line) displays what I would expect .....
some text is coming out of the DB with different urls in it, i want to delink it (like href="#" or something), how do i do that when i don't know what url is coming out?
I've got a function that I use to replace ' marks so the page will insert properly into a database - typically I use .Code:
whatever= request.form("whatever") whatever = replace(whatever,"'", "''") However, I've got some code that I unfortunately inherited from someone else that I can't get the replace to work:Code:
call buildquery (colq,valq,retq,"whatever") colq = "(" & colq & ")" valq = "(" & valq & ")" ssql = "insert into table_name " & colq & " values " & valq I was trying to do something in the call buildquery line to add a replace, but that doesn't seem to work.
How do I take out double quotes before writing to database? As doing ,""",""e;" created an error.Is it something like ,chr(34),""e;" which I sort of stumbled accross when I did soem google searching... But what and where do these chr(34) etc coem from?
I have lots of textbox that needs to have data entry. Is it possible for me to replace the tab key to return key that transfers the focus from one textbox to another? And also, how to submit the form after all textbox have values?
Even though I ask customers to enter there phone number like xxx-xxx-xxxx they some times don't. go figure:
I create a text file thats used by the factories EDI system and the number needs to be xxxxxxxxxx. I'm using the code below but what if they enter their number xxx.xxx.xxxx OR (xxx) xxx-xxxx etc. You get the idea.
I have a form in which several elements are expected to be all digits. Some of those elements can be left empty, but if specified they must be all digits. I have this Sub to edit them: ....
I am pulling info from a sql server By default the query pulls back the inforamtion as text.Therefore when I go to calculate some figures its giving me a type mismatch error. Is there a function in can call to convert a text string to an integer string using
rstSearch.Fields("name").Value .To pull back the info in a for loop
Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch
My form gets populated from an access database. Now in the database there are fields containg <br>. While in a normal page everything works as it's supposed to, in my listbox the <br> shows as it is. What I would like to do is replace it with a space so I've used this:
I've tried EVERY way i can think of to do this replace function, basically when i go to insert "Do's and Dont's into the database it cuts it off at "Do" because of the ' now ill show you my section of code that i have it in currently:
i use the URLencode function and it changes my form text to: this+is+it%21
ok, this is good, but when I use it in a URL, it includes "this" but then the link dies and the rest is just text, the user must then copy and paste the whole address in the browser. Anyway to get around this?
I am not sure if this is a question for this forum or the IIS forum but here goes. I have a dedicated server on which I am hosting about 80 websites at the moment, all of which have been created by copying a template site. All of these sites have an identical structure and are located in the same directory on the server, C:Inetpubvhosts. Several times when I have needed to make an adjustment to the sites I have to go into the remote desktop connection to the server and go site by site, copying and pasting files. For example, as each site has the same pages, ie., map.asp, sometimes I make a change to that page and have to copy it to every site. Could I write some sort of script using the FSO and execute it from one site and have it loop through each site on the server making the neccessary change(s)?