I have a need to replace multiple strings with others in a query
from p in dx.Table
where p.Field.Replace("A", "a").Replace("B", "b").ToLower() = SomeVar
select p
Which provides a nice single SQL statement with the relevant REPLACE() sql commands.
All good :)
I need to do this in a few queries around the application... So i'm lookin...
I am trying to replace a two letter state abbreviation with text then the abbreviation.
Eventually I want to find and replace the rest. How do I capture the value found? .... I tried \1 and {1}
AL 32.2679134368897 -86.5251510620117
AR 35.2315113544464 -92.2926173210144
AZ 33.3440766538127 -111.955985217148
CO 39.709863142533...
I have a string that may have a path to a file. Example src="/folder/whatever". How do I replace that path with src="http://www.sitename.com/folder/whatever ?
...
So what I'm trying to do is replace a string "keyword" with
"<b>keyword</b>"
in a larger string.
Example:
myString = "HI there. You should higher that person for the job. Hi hi."
keyword = "hi"
result I would want would be:
result = "<b>HI</b> there. You should higher that person for the job.
<b>Hi</b> <b>hi</b>."
I will not...
I have text file with a row like this:
SendersTimeSeriesIdentification: COMPANY_A/COMPANY_B/REF_7/20090505
I'd like to replace all non-word chars in the value part with the character n, like this:
SendersTimeSeriesIdentification: COMPANYnAnCOMPANYnBnREFn7n20090505
But there are similar strings all over the file, which must remain i...
Hi
I am having some trouble with this regex:
<img(.+)src="_image/([0-9]*)/(.+)/>
Global and case insensitive flags is on.
The problem is that it also grabs Image n (see string below), but I want it only to match the image tags in the string.
<p>Image 1:<img width="199" src="_image/12/label" alt=""/> Image 2: <img width="199" src="...
How do you replace all instances of one string with another in javascript?
Example:
someString = 'the cat looks like a cat'
anotherString = someString.replace('cat', 'dog');
results in anotherString being set to 'the dog looks like a cat', and I would like it to be 'the dog looks like a dog'
...
Hello! :-)
In one of my resultsets i have column with char - data. I want to create another column, which carries altered data from the first column. There i want to exchange all 'ö' with oe.
I tried it like this:
Select NAME1,
case when POSSTR(NAME1, 'ö') is not null then REPLACE(NAME1, 'ö', 'oe')
end As __NAME1
from xyz;
...
For the example, I'm trying to replace
<script type='text/javascript'>some stuff</script>
with:
<div type='text/javascript'>some stuff</div>
I'm currently testing with:
alert( o.replace( /(?:<\s*\/?\s*)(script)(?:\s*([^>]*)?\s*>)/gi ,'div') );
But what I'm getting is:
divsomestuffdiv
How can I get this to only replace the "sc...
How would I perform the following in JQuery?
var elmOperator = document.getElementById(elm.id.replace('Include', 'Operator'));
The ID that is being manipulated would look something like Criteria[0].Include. I am trying to create a variable for a related ID which is Criteria[0].Operator.
Thanks in advance!
...
HI,
I have a string that looks like
/dir/dir1/filename.txt
I want to replace the "filename.txt" with some other name leaving the "/dir/dir1" intact
so after the replace the string would look like
/dir/dir1/newfilename.txt
how would I do that using RegExp in Perl considering that I don't know the value of "filename"
Many Thanks...
Hello to all
I have some code in Netbeans 6.1 editor that looks like this
fooString(8)
fooString(8)
fooString(8)
fooString(8)
foostring2(8)
foostring3(8)
foostring4(8)
foostring5(8)
foostring6(8)
foostring7(8)
foostring7(9)
foostring7(10)
foostring7(11)
foostring7(12)
and i want to convert it to
fooString(1...
I have a text file that is being written to as part of a very large data extract. The first line of the text file is the number of "accounts" extracted.
Because of the nature of this extract, that number is not known until the very end of the process, but the file can be large (a few hundred megs).
What is the BEST way in C# / .NET to ...
User SQLServer 2005
Here is an example of string I'm stuck with: {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Arial Rounded MT Bold;}{\f1\fnil\fcharset0 Arial;}} \viewkind4\uc1\pard\f0\fs54 1000\f1\fs20\par }
I want to replace any font name with 'Times New Roman'
I can get the first one with (textlong1 is ...
I have written the following constraint for a column I've called 'grade':
CONSTRAINT gradeRule CHECK grade IN (‘easy’, ‘moderate’, ‘difficult’),
Is it possible to later update the gradeRule to have different values? For example, 'moderate' and 'difficult' could be changed to 'medium' and 'hard'.
Thanks
...
I have a large number of csv files that look like this below:
xxxxxxxx
xxxxx
Shipment,YD564n
xxxxxxxxx
xxxxx
1,RR1760
2,HI3503
3,HI4084
4,HI1824
I need to make them look like the following:
xxxxxxxx
xxxxx
Shipment,YD564n
xxxxxxxxx
xxxxx
YD564n,1,RR1760
YD564n,2,HI3503
YD564n,3,HI4084
YD564n,4,HI1824
YD564n is a sh...
Hi All,
is there any way how to replace block of text (multi-line) in VS2008(VS2005)? So far I know VS2008 supports only single line replacing.
Any tips welcome, cheers X.
EDIT: thanks for tips guys. I was rather looking for some simplier option: like select multiline text, click Ctrl+H, Ctrl+V (copy text from memory) and hit Repla...
I am trying to wrap my head around using regular expressions and replace() with JavaScript, but have not yet been successful
Suppose I have a string containing this:
<img alt="a picture of ..." src="image/1533?foo=1&bar=2$zot=3" width="500" />
If zot=3 I want remove foo (and its value) (or replace foo=x with an empty string).
The re...
Hi,
How do you replace an element in jQuery and have the replacement element returned instead of the element that was removed?
I have the following scenario. I have many checkboxes and once you click one of them, that checkbox is replaced by a loading icon. Once some AJAX stuff happens, the loading icon is replaced by a tick icon.
Usi...
I'm using TinyMCE (WYSIWYG) as the default editor in one of my projects and sometimes it automatically adds <p> </p> , <p> </p> or divs.
I have been searching but I couldn't really find a good way of cleaning any empty tags with regex.
The code I've tried to used is,
$pattern = "/<[^\/>]*>([\s]?)*<\/[^>]*>/";
$str = preg_replace(...