replace

How can I replace characters from a databound object?

I have this: <img id="imgField" alt="" runat="server" src='<%# string.Format("images/{0}.jpg", DataBinder.Eval(Container.DataItem,"Name")) %>' /> and it's rendering %20's from the spaces in the databound Name. So I need to replace all of the "%20's" with "" I tried <img id="imgField" alt="" runat="server" src='<%# string.Format("ima...

sIFR: Not working for custom divs more than once.

Using sIFR rev. 436, latest release. Replaces h1, h2, h3, h4 tags flawlessy, as many as I have on the page. However, if i try replacing a custom div, say Replace Me it replaces only the first instance, but not the others on the page. I tested this on the 2.0 release as well and got the same results. Is this just a limitation of the s...

Replacing javascript functions using PHP

I want to use PHP to replace javascript functions in HTML documents. For example: original: function my_function(hey) { do stuff } new: function new_function(hi) { do different stuff } I was thinking of using regular expressions with the ereg_replace function, but I'm not sure if this is the best approach. The code in each...

Word Automation: Replace an Image using C#

Hi - I'm trying to change text and images in a word document using c# and word automation. I've got it working fine for text where I do something like the snippet below, but I don't even know how to start for replacing the image. Any help is greatly appreciated! Oliver using Microsoft.Office.Interop.Word; ... private static Applicat...

What is the equivalent function for REPLACE(of Oracle) in sybase

strong text ...

Replace character in SQL results

This is from a Oracle SQL query. It has these weird skinny rectangle shapes in the database in places where apostrophes should be. (I wish we would could paste screen shots in here) It looks like this when I copy and paste the results. spouse�s is there a way to write a SQL SELECT statement that searches for this character in the fie...

MYSQL: How can I create a MySQL table so, that a field's default value is the output of a function.

QUESTION How can I create a MySQL table so, that a field's default value is the output of a function. Can it be done without an insert trigger? BACKGROUND: Some entities and the groups they belong to need to be observed on a daily basis. To do that I created the following MySQL table: CREATE TABLE entity ( entity_id VARCHAR(1...

JavaScript replace/regex

Given this function: function Repeater(template) { var repeater = { markup: template, replace: function(pattern, value) { this.markup = this.markup.replace(pattern, value); } }; return repeater; }; How do I make this.markup.replace() replace globally? Here's the problem. If I use i...

Match any character (including newlines) in sed

I have a sed command that I want to run on a huge, terrible, ugly html file that was created from a microsoft word document. All it should do is remove any instance of the string style='text-align:center; color:blue; exampleStyle:exampleValue' The sed command that I am trying to modify is sed "s/ style='[^']*'//" fileA > fileB It w...

Hints for java.lang.String.replace problem?

I would like to replace "." by "," in a String/double that I want to write to a file. Using the following Java code double myDouble = myObject.getDoubleMethod(); // returns 38.1882352941176 System.out.println(myDouble); String myDoubleString = "" + myDouble; System.out.println(myDoubleString); myDoubleString.replace(".", ","); System...

Javascript: replace a string in element.src attribute

Hi I am currently trying to replace a query string value in a a link's src attribute. it works fine in firefox but not in ie. example: <a id="link" href="#" src="http://somedomain.com?id=123&amp;size=20"&gt;link&lt;/a&gt; then on my js it looks kinda like this: var link = document.getElementById('link'); link.src.replace('size=20'...

How can Replace infinite loop?

I am working on some rather inefficient C# code that wants to remove blanks lines. It does this: string b; ... while ( b.IndexOf("\n\n") >= 0 ) b = b.Replace ("\n\n", "\n"); A single replace would not cope with (e.g.) \n\n\n in the input, so the loop is needed. I think it ought to work, and it usually does. But...

How do I replace tabs with spaces within variables in PHP?

$data contains tabs, leading spaces and multiple spaces, i wish to replace all tabs with a space. multiple spaces with one single space, and remove leading spaces. in fact somthing that would turn Input data: [    asdf asdf     asdf           asdf   ] Into output data: [asdf asdf asdf asdf] How do i do this? ...

Replacing a html tag with another tag using JS DOM

Hi everybody, I am fairly new to javascript and DOM and I am having a problem with manipulating DOM using javascript for the following html code. <html> <head> <title>Testing</title> </head> <body> <marquee direction=up height=400 scrollAmount=3.7 scrollDelay=70 onmousedown="this.stop()" onmouseover="this.stop()" onmousemove...

python string search replace

SSViewer::set_theme('bullsorbit'); this my string. I want search in string "SSViewer::set_theme('bullsorbit'); " and replace 'bullsorbit' with another string. 'bullsorbit' string is dynamically changing. ...

How to use mod_rewrite to change external incoming images to local images?

Hi, I'm trying to figure out how to use mod_rewrite so that I can replace linked images (coming in externally) and use local ones instead. Why am I doing this? I have a plugin which I'm integrating into my site, which uses ugly external images as buttons, and I want to redo these buttons to match my site. The links come in external...

VB.NET Regex.replace <>

Hi Im pretty new to regex and im having trouble using VB and regex. Im trying to remove a <span ....> comment and replace it with <b> so far ive got this: Regex.Replace(text, "<span[^>]*>", "<b>", RegexOptions.IgnoreCase) This correctly matches the span comment but when it replaces it with the string it strips the <> and just leav...

Tool to replace include with its own contents?

I'm faced with the task of find and replacing multiple include files with the include file's content. Just wondering if I'd be quicker copy / pasting than writing a bit of code to do so, or if there's a tool out there that could do this for me? Pretty sure its a common need. I'm on Windoze btw. Any suggestions welcome. Just to clarif...

Delphi read next line and replace

I have a program that imports a text file that has many entrys: ### Starttime: 06.03.2008 Data: SOME RECORDS HERE ### Starttime: 21.03.2008 Data SOME RECORDS HERE ... and so on Not I want to have an end time after "Data:" that is the next starttime -1 so i have ### Starttime: 06.03.2008 Data: SOME RECORDS HERE EndTime: 20.03.2008 ...

top.location.replace creates history item in Safari/Chrome

At this point we have a photogallery which uses hashvalues to determine which picture is currently showed to the user, and to support sending the page to a friend and such. Something like: http://url/photos/#photo-4 When we have loaded the corresponding picture after clicking the next or previous button, we change the url according to ...