Your challenge today is to initialize an individual's middle name (if there is any).
Example:
'Jack Ryan' => 'Jack Ryan'
'Lois Mary Lane' => 'Lois M. Lane'
'Dimitri' => 'Dimitri'
'Alice Betty Catherine Davis' => 'Alice B. C. Davis'
Good luck!
This challenge comes from manonacodingmission on CodeWars. Thank you to CodeWars, who has licensed redistribution of this challenge under the 2-Clause BSD License!
Want to propose a challenge for a future post? Email yo+challenge@dev.to with your suggestions!
Latest comments (20)
JavaScript:
Here is the simple solution with Python:
Python
My solution in js
Python.
I had two attempts at this, my first was only for full names up to three words but after realising I needed to expand the program to work on more I rewrote the program. Both and posted below and annotated.
First attempt
Second Attempt
I wasn't too happy on the result,
Any pointers on how to I could improve my code would be great!
But ey it works,
😁..I am uh, very, mature.
PHP Solution
Python :
Nice,
Here's my Python solutions!
dev.to/teotcd/comment/e6fl
ruby <3