I discovered how to do it.. for anyone interested i did it using groups:
Regex.Replace(myString, "([^\\n])(\\n)([^\\n])", "$1 $3");
this will find every sole occurence of \n and replace it with a space.
There was something i forgot to mention before..
string result = Regex.Replace("cat\n monkey \n\n mouse", "[^\\n]\\n[^\\n]", " ");
'result' in this case will be: "ca monkey \n\n mouse" because the letters being replaced are "t\n " ie. the \n and the surrounding letters. How do i only find one...
Hi,
can anyone give me the regular expression for finding sole instances of "\n", not grouped in twos or more.. something along the lines of:
{not "\n"}{"\n"}{not "\n"}
Thank you,
shady
im not sure where you got 'screen.innerWidth' because it's undefined for me and i'm using IE6.. are you sure that attribute exists? and if it does is it not only measuring the width of the screen (not the browser)?
Hi, i was wondering does anyone know how to set the minimum width a user can resize their window to? i dont want it to be resized to less than 400px say.. using javascript or whatever..
Hello,
I'm trying to override the "reject" cursor that appears when i try to drag a fixed element element. For example i have:
<img src="redx.gif">
and when i try to drag the image the cursor changes to the "reject" cursor. I want to try to override that and make it the "hand" cursor.
Any...
i figured out a way that works nicely for those that are interested.. (the elements being dragged are not visible during the drag).
i'll call the frame where things are dropped the receiving frame and the frame where dragging commences the sending frame.
in the body of the receiving frame...
Hello,
I'm trying to simulate a drag and drop operation across frames. I have 4 frames and i want to be able to tell when:
1) the user's mouse button goes down in a specific frame (say frame 2)
2) it stays down as he moves it across to another specific frame (say frame 4)
3) he releases the...
yeah that's all taken care of.. all i need to be alerted on is everytime the main frame is reloaded so i can do what i need to do in the contents frame.
hello,
i'm trying to create a navigation path (roadmap) that shows users where they are in my website.. i have two frames, one is the main frame where the pages are loaded and the other is the contents frame and where i want my roadmap path to appear. My question is this: i want my contents...
Hello,
I have an embedded datagrid inside a repeater whose datasource i set in the repeater's ItemDataBound event handler. My question is this: if i want to make the datagrid sortable do i initialise the datagrid's SortCommand in the same place where i set it's datasource? If my repeater is...
well that is a solution.. but im still iterating. I thought maybe i could alter the property directly in the class from which all those elements get their style and then they would all somehow all be modified.. but i guess it doesnt work that way. Am i right? In any way im going to have to call...
i guess the only reason i want to directly alter the class is so i dont have to iterate through all the elements that inherit properties from that class..
im still hopeful of a way
hi,
does anyone know of a way to modify a css classes' properties using javascript such as this simple style:
<style>
.highlightedCell
{
BACKGROUND-COLOR: RED;
}
</style>
lets say i have some cells in a datagrid that have this class and then i want to change their...
document.frames['main'].document.body returns undefined.. i think there's a security issue that prevents one frame from accessing objects in another maybe..
Hello,
I have a page with two frames in it as follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>title</title>
</head>
<frameset>
<frame name="banner" src="banner.aspx">
<frame name="main" src="main.aspx">
</frameset>
</html>
is there anyway i can...
hello,
i have a button, a datagrid and a textbox
this is my code:
private void button1_Click(object sender, System.EventArgs e)
{
DataTable dt = getDevices();//returns a datatable
dtgEvents.DataSource = dt;
dtgEvents.Refresh();
}
my getDevices() method reads the value in the textbox...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.