Challenge: Extract Initials
Swipe to start coding
Write a function that takes a full name as a string and returns the initials in the format "X.Y." where X and Y are the first letters of each word in the name, capitalized and separated by periods.
- Split the
fullNamestring into words. - Take the first character from each word, convert it to uppercase, and add a period after each letter.
- Return the constructed initials string.
Soluzione
Grazie per i tuoi commenti!
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Can you explain this in simpler terms?
What are the main benefits or drawbacks?
Can you give me a real-world example?
Fantastico!
Completion tasso migliorato a 4.76
Challenge: Extract Initials
Scorri per mostrare il menu
Swipe to start coding
Write a function that takes a full name as a string and returns the initials in the format "X.Y." where X and Y are the first letters of each word in the name, capitalized and separated by periods.
- Split the
fullNamestring into words. - Take the first character from each word, convert it to uppercase, and add a period after each letter.
- Return the constructed initials string.
Soluzione
Grazie per i tuoi commenti!
single