Simple answer.
What matters is the type of end, and adequate length.
Here's a picture of common cable ends
.
You need either type B or C.
B is typical or drop bars, and C on upright handlebar brake levers, but rather than guess, just look at what you have.
You can also buy kits which include the housing, and I suggest you do so, because the housings tend to have shorter life than the inner wires.
Simple question, simple answer, have fun