Unless the LED has a flat or other mark on the case to indicate which wire is the anode and which is the cathode, the usual way to figure it out is one lead will be longer than the other. If you cut them both off short, obviously this goes away. With a clear or translucent case LED< you cna hold it up to the light and determine which is which - since if you wire it backwards, it won't light up. Won't be damaged though - but soldering and then unsoldering it and then soldering it again is just asking to overheat it. The picture here shows you how to determine polarity in absence of any other markings:
http://en.wikipedia.org/wiki/LED_circuit
(scroll down to the polarity section)
--Randy
Modeling the Reading Railroad in the 1950's
Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.
I see; Thanks for reminding me the overheating issue.
You can certainly trim the LED legs back. at a minimum you should leave at least a 1/4" for the shorter leg , a bit more for the longer leg. Be aware that the shorter the legs are the easier it is to overheat the LED when soldering, so practice your solder skills, a little flux will help the solder to flow faster.
Jay
C-415 Build: https://imageshack.com/a/tShC/1
Other builds: https://imageshack.com/my/albums
I thought of a great idea. I decided to replace the original incandescent bulbs that came with the Walthers DCC version lighting kit with LEDs. Now will I need one resistor or a resistor for every bulb? There are three incandescent bulbs. Not that I don't know my basic electronics I often forget the difference between series and parallel circuits. It's hard for me to tell weather the Walthers lighting kit is wired in series or parallel. I will assume that an LED should not be damaged if the anode and cathode are cut (trimmed) off for space.