Challenge: Extract Initials
Opgave
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.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 4
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Suggested prompts:
Can you explain this in simpler terms?
What are the main benefits or drawbacks?
Can you give me a real-world example?
Fantastisk!
Completion rate forbedret til 4.76
Challenge: Extract Initials
Stryg for at vise menuen
Opgave
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.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 4
single