replace

iPhone dev: Replace uppercase characters in NSString with space and downcase

I have: NSString *promise = @"thereAreOtherWorldsThanThese"; which I'm trying to transform into the string: @"There are other worlds than these" I'm guessing this is a regex job, but I'm very new to Objective C, and have so far had no luck. I would greatly appreciate any help! ...

Replace or recode several different values by a single value in an Excel file

Hi all, I have an Excel worksheet which contains data in several columns. For a specific column, I will need Excel to replace all values between, say 10 to 15, by the value 1 and values between 16 and 20 by the value 2 and so forth. I know how to do it for a single value; ie: I can replace value 10 by 1, 11 by 1 and so on. But this wil...

Java String.replaceAll regex

I want to replace the first context of web/style/clients.html with the java String.replaceFirst method so I can get: ${pageContext.request.contextPath}/style/clients.html I tried String test = "web/style/clients.html".replaceFirst("^.*?/", "hello/"); And this give me: hello/style/clients.html but when I do Stri...

How to create a drop-in replacement for an existing dll?

Beyond creating a dll with all the same functions with the same interface and calling conventions, does the replacement dll need to exactly duplicate the export map including ordinal numbers of the original as well? So that not only explicit loading via GetProcAddress works, but implicit linking as well? (edit: this is an unmanaged, ...

Javascript: Find and replace tag

I'm trying to find <body onload="function();"> and replace it with <body> on onClick event. Any suggestions how this could be done? Thank you. UPD. Sorry for an unclear question. Crozin answered my question, I was just trying to remove onload attribute. ...

jQuery click event to make a div slide down and push next div out of viewport

I'm trying to figure out how to make jQuery slide #content2 down and replace #content1 with it while making it look like #content1 is actually being pushed down by #content2 removing it from view... Then the same button that was clicked to make #content2 replace #content1 would also need to do the reverse effect by replacing #content2 w...

Prototype problem with replace

Hi, in my html page, I have the following: <div id="rub"> Select at least one Rub </div> In the script code, I have if ( some condition ... ) $('rub').replace("Rubs selected:"); Which works fine, but when a second event is triggered, in the code I have if ( some other condition ... ) $('rub').replace("Selected at least one...

how to replace quotation marks with \"

hello. im trying to echo mediaplayer embed code with IF statement. is there any way to replace all quotation marks (") with (\")'s ? thank you.. ...

how to replace specific strings in HTML docs or specific elements ?

How can I parse a html document or just a html element in order to replace all specific strings into other ones ? In other terms: - search for all strings #### in element .class - replace them with $$$$$ I'm using jQuery.. thanks ...

Replace More Than 1 Instance with PHP

Say I have sometext-somemore--test---test2 how could I have it replace all instaces where there are more than 1 - and have it replace them with just 1 so it would look like this sometext-somemore-test-test2 ...

String Seach Replace AS3

I have a bit of text "this is the text want I want to do is replace the text, I have just added another is for good measure" This is stored as a standard string but I want to turn this into html and add css classes like, in this example wrapping around the word "is"; "this is the text want I want to do is replace the text, I have ju...

Replace every tab (key) with string in jQuery?

Hello I need to go though a content of element, and replace every tabulator \t with text "(Here's a tab)". How is this possible? Martti Laine ...

Regex.Replace only replaces start of string

I'm trying to replace a friendly url pattern with a html url notation but due to lack of regex experience I can't figure out why my regex only replaces the first occurence of my pattern: string text = "[Hotel Des Terrasses \http://flash-hotel.fr/] and [Du Phare \http://www.activehotels.com/hotel/]"; text = Regex.Replace(text, @"\[(.+)\s...

Replacing delimiter characters in file path

I'm developing a C# web application in VS 2008. I let the user select an input file and then I store the file path in a string variable. However, it stores this path as "C:\\folder\\...". So my question is how do I convert this file path into single "\"? Thank you guys for all your helps! Please forgive me as I am a newbie to ASP....

Replace text in folder names

How can I replace the same text in folder names in linux? Say I have "Photos_Jun", "Photos_July", "Photos_Aug", etc. whats the simplest way I can rename them like "Photos Jun", "Photos July", etc (basically I want to replace the underscore with a space " ". I have about 200 of these folders. I was looking at solution: http://stackoverf...

Finding and replacing content between brackets with jQuery

I have a requirement to place text between brackets using jQuery; the content will be updated once an action occurs e.g. search. The structure is: - <h2>Placeholder Text Placeholder Text Placeholder Text ()</h2> ...

jQuery replace text between parentheses

Hi, I have a requirement to replace the text between () in a string. ...

string replace in file using C

I haven't yet implemented this, I'm still in the thinking stage, but I have to go through a file and replace a certain string with another string. For example, <img src="/images/logo.gif" ... should become <img src="/proxy/www.example.com/images/logo.gif" ... Any advice on how I can approach this? Perhaps there exist some "string r...

String replace for personalize code generator

I must do a automatic codes generator with user-configurable string with predefined keys and can not find a good way to do it. For example, a string OT-{CustomCode}-{Date}-{##} could generate codes OT-C0001-20100420-01 OT-C0001-20100420-02 I thought of using RegExpr.Replace(), but I would have problems if the code of a customer wa...

smarter character replacement using ruby gsub and regexp

Hi guys! I'm trying to create permalink like behavior for some article titles and i don't want to add a new db field for permalink. So i decided to write a helper that will convert my article title from: "O "focoasă" a pornit cruciada, împotriva bărbaţilor zgârciţi" to "o-focoasa-a-pornit-cruciada-impotriva-barbatilor-zgarciti". Wh...