My son recently broke the string on the light cord in the bathroom. I opened it up in perhaps the naive expectation that someone would have designed that in such a way that the string can be reattached. Sadly it wasn't.
In fact when you open the interior plastic piece the whole thing springs apart and everything from the clicking mechanism to the electrical terminals explode in different directions.
Thankfully, someone had uploaded a video of a very similar switch and, after a few cross words (man I hate assembling mechanisms with springs), I had a new overhand knot in the string and all of the contacts, springs and terminals back in place.
I would, without doubt, drive down to a shop and buy a new one next time...
The ones here in the UK have these little plastic connectors on the string. The switch itself has a very short string coming out of it(<10cm), the plastic connector and then the main pull cord. These connectors are simple tubes with an opening that hold and hide the knots. Makes changing the pull cord quite easy, you just feed it through the hole in the connector, tie a simple knot at the end and pull it back into the connector body.
I actually had one of these connectors break on a bathroom light and just 3D printed a new one. But it should be fairly trivial to add one of these to any light pull you already have.
https://www.thingiverse.com/thing:5140505 (not my design)
Yeah, for some reason the knot broke on the inside rather than at that connector.