Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Extract Initials | Fundamentals of Strings
C# Strings & Text Processing

bookChallenge: 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 fullName string 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?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 4
single

single

Spørg AI

expand

Spørg AI

ChatGPT

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?

close

bookChallenge: 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 fullName string 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

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 4
single

single

some-alt