Format NSE Stock Order Code
Format NSE Stock Order Code
EasyStrings100% accepted
Priya works at a Mumbai brokerage processing NSE orders. She receives codes like 'RELIANCE-BUY-1000-24MAY2026' and must reformat them to 'RELIANCE_BUY_1000' for legacy systems.
Approach
Given an NSE stock order code with symbol, action, quantity, and date separated by hyphens, extract and reformat the first three components with underscores.
Input
MARUTI-BUY-3120-01JUN2026
Output
MARUTI_BUY_3120
More Strings problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards