Can I solder two USB cables together?
Soldering in a replacement usb cable is easy enough, just make sure that the correct wires go on the correct terminals.
Most usb cables have red and black as supply positive and negative, while the data pair are green and white. If different you need to check which is which with a multimeter or continuity tester.
Just to show one, this is from an old cable I was testing something else with:

Note that the &quot;red&quot; is more pink...