replace

replace last part of a string in directory address

i have this as a string that shall come in - C:\abe\123-anb\porl\xyz.gif I want to replace the xyz.gif with abe.zip how can i do this in vb? ...

In MySQL, how do I insert only when row doesn't exist and update only when existing version is less

I am looking for a way to only insert when the row does not exist in MySQL, and update when the row exists AND the version of the existing row is less than (or equal to) the version of the new row. For example, the table is defined as: CREATE TABLE documents ( id VARCHAR(64) NOT NULL, version BIGINT UNSIGNED NOT NULL, data BLOB,...

MySQL replace spaces.

The contents is " hello world hello. <a href="#">hello</a> " How to replace space before "hello" to &nbsp;,and not replace the space between a and href. ...

Regex replace all except of this string

Hi ! I have a XAML document and I want to select all texts with Regex with this form: Default=xyz} I wrote for it this very simple regex and it works: Default=.+} Now, how do I exactly the opposite? I want to delete all other text than this in the document. I'm using Notepad++. Thanks ...

LINQ lamba expression to replace multiple characters in a string?

Hi, Is it possible to write a lambda expression that will iterate through array of objects and replace all occurences of 'X', 'Y', ' ' and 'Z' in one of the properties? E.g. return query.Select(x => { x.SomePropertyName= x.SomePropertyName.Trim().Replace(' ', "_"); return x; }).ToList(); For some reason, a query above doesn't repla...

string replace using a List<string>

I have a List of words I want to ignore like this one : public List<String> ignoreList = new List<String>() { "North", "South", "East", "West" }; For a given string, say "14th Avenue North" I want to be able to remove the "North" part, so basically a function that would r...

Regular expression for allowing only a certain set of characters

I would like some help creating a regular expression for parsing a string on a textbox. I currently have these two javascript methods: function removeIllegalCharacters(word) { return word.replace(/[^a-zA-Z 0-9,.]/g, ''); } $("#comment").keyup(function() { this.value = removeIllegalCharacters(this.value); }); I would like to rep...

C# Regex Replace Pattern (Replace String) Return $1

I'm currently working with parsing some data from SQL Server and I'm in need of help with a Regex. I have an assembly in Sql Server 2005 that helps me Replace strings using C# Regex.Replace() Method. I need to parse the following. Strings: CAD 90890 (CAD 90892) CAD G67859 CAD 34G56 CAD 3S56. AX CAD 89...

how to replace special character from string in asp.net

my code - txtPhoneWork.Text.Replace("-",""); txtPhoneWork.Text.Replace("_", ""); txtMobile.Text.Replace("-", ""); txtMobile.Text.Replace("_", ""); txtPhoneOther.Text.Replace("-", ""); txtPhoneOther.Text.Replace("_", ""); location.ContactWork = txtPhoneWork.Text.Trim(); location.Co...

How to replace " in .NET

Simple! How to replace " in .NET with something...? ...

JavaScript Regex to Java Regex - Replace and Lambdas

What is the best way to approach translating this code into Java? (the section called Convert Alpha-numeric Phone Number to All Numeric) http://lawrence.ecorp.net/inet/samples/regexp-format.php Since Java doesn't have a lambda yet... what is the best approach for the String.replace ? ...

Replacing the "X" in this url www.websitename.com/info.php?lid=X

Help please. I am looking for the best way to replace the "X" (number) in this url www.websitename.com/info.php?lid=x the "x" is a numerical value - i would like to replace the "X" with the "name" field from my database. Is mod rewrite the way to go? I have multiple urls of the same format (different "X" value of course at the end) ...

C# Replace HEX in binary file

I have a binary file, where are a few values what should be changed. To be more exact, at two part of the file, in the beginning, there are two HEX values 66 73 69 6D 35 2E 36 39 what should be changed to 4D 53 57 49 4E 34 2E 31 How could I do this async, and as fast as possible? I've got to the point where I read the whole file in...

PHP: Conditional charset replace in preg_replace

I have a site scraped into $html variable. now i want to replace some chars with this expression $string1 = preg_replace('/[^A-Za-z0-9äöü!&_=\+-]/i', ' ', $string); The Problem is there are special characters caused by different charsets. I have a variable $charset in which the charset string of the page is saved. i.e. $charset="utf...

What happens when starting a .NET console application?

What exactly happens when a .NET console application starts? In the process explorer, when starting the exe I am wondering why I cannot see a "cmd.exe" process as a parent process for the console application. What exactly is displayed then? Is there a way to replace the "default" console window by another one? I guess this would mean m...

GVIM. How to change certain words that match the pattern?

In normal mode I press +* and VIM highlighs the occurences of the word under cursor. How to change for example 2,4-5 (second, fourth and fifth) words in search results with %s command? I know I can use %s and to change the searched word in certain lines, but it is not what I need. ...

Add text at the end of document fragments on a Mac

On a Mac, I have a directory of html files that are all document fragments. Using the TexFinderX app, I was easily able to do a find/replace and add everything at the top of the documents that I wanted (i.e. etc.) . Now I need to find a way to add the closing tags to all of the documents (i.e. ). TexFinderX does not have a way to d...

replace current view with any existing new view

Hi. In short I would like to call a method from a viewSwitchManager class that contains a method which would switch the current view on display to a different view. -(void)replaceView:(UIView*)oldSubView withView:(UIView*)newSubView; I am trying to implement the following: In my project I have 10 views they all have their own .m and...

PHP - replace values of array with another array

Is there a way i can replace the values of one array with the values of another which has identical keys? $arr1 = Array ( [key1] => var1 [key2] => var2 ) $arr2 = Array ( [key1] => var3 [key2] => var4 ) I want to change $arr1's values to the ones in $arr2 i...

Javascript Regex - Replace { with nothing

Hi, i have a little problem and i have no idea what is wrong var selector_css; var sheet= document.styleSheets[0]; var rules= 'cssRules' in sheet? sheet.cssRules : sheet.rules; for (var i= 0; i<rules.length; i++) { var rule= rules[i]; var text= 'cssText' in rule? rule.cssText : rule.selectorText+' {'+...