But these cables came together with sensors for example, potentiometer, IR reflector sensor, etc. And on both end of the cable, they are pre-assembled with locking ramp housing or Polarizing ribs. If I cut two of them, and solder them to extend the length, I would lose a cable to use with the sensor that the cable came with. So it was not worthwhile to do so.
My solution was NOT to cut, and use match 3-pin male headers obtained from Sparkfun's, and solder them together to make a DIY cable extender.
Here is how I did it.
2 nos. of 3-pin JST male headers. (http://www.sparkfun.com/products/10207)
Small piece of 5/8" Heat Shrink Tubing
Mount both 3-pin male connectors on the vise. One connector face up and the other face down.(See picture no. 3)
Make sure the leads are overlap.
Solder the leads the middle leads together. Then solder the outer leads on one side together. And solder the outer leads on the other side together.
Make sure that there are no contact among the neighbor leads. (See picture no. 4)
Prepare the heat shrink tube to cover the soldered connector. Apply the heat to the heat shrink tube with hair dryer or heat gun.
Repeat Steps to make more than one connectors.
NOTE: This tip is not only limited to JST type connector, nor limited to 3-pin leads. It could be used with other Polarizing Ribs or Housing, such as Molex Jumper Wire, etc. with 2-pin, 4-pin or 5-pin leads.