A unique problem which deals with advanced string manupulation (adding capital letter after certain symbols, removing multiple spaces, adjusting width)
A unique problem which deals with advanced string manipulation (adding capital letter after certain symbols, removing multiple spaces, adjusting width)
Problem Statement:
Input:
A string input from the user (within one single line)
Left width, Right width and Total width
Rules:
1.In the given string, multiple spaces should be converted into a single space.
Output:
Output the final result based on the above rules
INPUT:
I love programming! i started programming,when i was 10 years old.i enjoyed it.
left width = 3
right width = 5
total width = 10
OUTPUT:
Removing multiple spaces:
I love programming! i started programming,when i was 10 years old.i enjoyed it.
Text after capitalizing and prefixed with a single space:
I love programming! I started programming, When i was 10 years old. I enjoyed it.
Final result=
$$$I *
$$$l o *
$$$v e *
$$$ p *
$$$r o *
$$$g r *
$$$a m *
$$$m i *
$$$n g *
$$$! *
$$$I *
$$$s t *
$$$a r *
$$$t e *
$$$d *
$$$p r *
$$$o g *
$$$r a *
$$$m m *
$$$i n *
$$$g , *
$$$ W *
$$$h e *
$$$n *
$$$i *
$$$w a *
$$$s *
$$$1 0 *
$$$ y *
$$$e a *
$$$r s *
$$$ o *
$$$l d *
$$$. *
$$$I *
$$$e n *
$$$j o *
$$$y e *
$$$d *
$$$i t *
$$$. *