0

I apologize for the stupid question. I encountered the following problem: I must copy java-code from site to Eclipse, where each line began with it's number, for example:

49     try {
50              Object[] args = new Object[] { null, b, new Integer(0),
51                      new Integer(b.length) };
52              clazz = (Class) method.invoke(loader, args);
53          } finally {
54              method.setAccessible(false);
55          }
56          return clazz;
57     }
58  

but Eclipse, of course, doesn't recognize this code. And I'm tired of manually delete numbers. Does Anybody Know how to automate this process?;)

1
  • You're code makes absolutely so sense
    – mrres1
    Aug 12, 2014 at 12:39

4 Answers 4

7

you can simply copy and paste then use vertical selection (default: alt+shift+A) in eclipse

1
  • Didn't know this awesome feature before. Would certainly have saved me some wear and tear on my keyboard. Aug 12, 2014 at 12:27
0

You can also use the find-replace feature.

Just do CTRLF on the editor, in the "find" input, write

^\d+(.*)$

And in the "replace" input field write

$1

Then check the "Regular expression" checkbox, and click "replace all"

0

There's a multi-selection option (multiple lines).

It's an icon in the toolbar under the menu.

The Windows shortcut is Alt + Shift + A

0
alt+shift+A            

sortcut for part selection

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.