removing

How to replace multiple newlines in a row with one newline using Ruby.

I have a script written in ruby. I need to remove any duplicate newlines (e.g.) \n \n \n to \n My current attempt worked (or rather not) using str.gsub!(/\n\n/, "\n") Which gave me no change to the output. What am I doing wrong? ...

C# event removal syntax

I am confused by the syntax for removing event handlers in C#. Something += new MyHandler(HandleSomething); // add Something -= new MyHandler(HandleSomething); // remove The "new" creates a new object on each line, so you add one object and then ask it to remove a different object. What is really going on under the covers that this c...

JQuery Removing all , except matched rows

Hi All, I am trying to remove all the rows from a table EXCEPT the matched rows: This code removes the rows that I in fact want to keep - $("table#traffic").each(function() { $("td:contains('" + selected_text + "')").parent().remove(); }); I basically want to do the opposite of the above. ...

how to remove or hide videofile extn in qt

hi i am having one insert button from which i can select videofiles either from phne memory or memory card.but all the files are coming with name and extn(.3gp).how i will remove this or hide this in QT ...

Adding or Removing HID programatically

Hello, I intend to remove a HID from my system programatically. The HID is connected via a bluetooth. Can you please help me on this. I plan to use C# but any thing else that is better shall also help. Thanks ...

Components are not longer resizable after moving

Hi guys My question relates to swing programming. I want to enlarge a component (component x) by removing it from its parent panel (component a) and adding it in one of component a's parent (component b). Before that, I call setVisible(false) on all components in b. After that I want to make this back by removing it from b and adding on...

I'm trying to remove empty items in listbox in C#

So i want to remove empty items in listbox like whitespace so Far I have this code. But the compiler is giving me an error for (int i = 0; i < listBox2.Items.Count; i++) { if (listBox2.Items[i].ToString = " "){//ERROR* listBox2.Items.RemoveAt(i); } } *Cannot convert method group 'ToString' to non-delegate type 'bool'. ...

remove unwanted styles from objects using jquery (or php)?

Hi all, I was wondering if there was any way of removing unwanted style attributes from objects (p, ul, li etc), as for some reason my client has decided to copy/paste information from word into a wysiwyg and doesn't bother removing the crap that comes along with it, I was wondering if jquery could do this? Here's an example of the ou...

Removing an item from a many-to-many association in NHibernate

Dearest All, I have a one-directional many-to-many association: the ListDefinition class has the Columns property of type IList, while a column can be part of several ListDefinition-s. The problem is, whenever I try to remove a column from one Columns collection (without deleting it or removing from other ListDefinitions), I'm getting t...

Trim any zeros at the beginning of a string using PHP

Users will be filling a field in with numbers relating to their account. Unfortunately some users will have zeroes prefixed to the beginning of the number to make up a six digit number (e.g. 000123, 001234) and others won't (e.g. 123, 1234). I want to 'trim' the numbers from users that have been prefixed with zeros in front so if a use...