Stinger Sword (5e Equipment)
From D&D Wiki
Weapon (longsword), uncommon (requires attunement)
A normal looking sword that can transform into a long, bladed whip. The cord attached to the blade is very stretchy, and can extend much further than one would first assume.
Special: When you make you attack action, you may choose make one of three attacks. You may make a normal melee attack, choosing either the normal damage or utilizing the weapon's versatile properties, or you may choose to extend head at one target, making a ranged attack (15/30) using your Dexterity modifier. On a hit, the target takes 2d4 piercing damage.
Alternatively, you may swing the blade with the whip extended, attacking all targets in a 15-foot cone. All targets within the cone must make a Dexterity saving throw against a DC 8 + proficiency bonus (If proficient) + either your Strength or you Dexterity modifier or take 1d6 slashing damage.