Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Extract Initials | Fundamentals of Strings
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# Strings and Text Processing

bookChallenge: Extract Initials

Tehtävä

Swipe to start coding

You are given a full name as a single string. The name may contain one or more spaces, and you must:

  1. Extract the first name (everything before the first space).
  2. Extract the last name (everything after the last space).
  3. Generate the initials in the format F.L..

If the input does not contain any spaces, treat the entire string as a first name and display:

  • First name
  • "Last name not found"
  • Initials using only the first letter (e.g. J.)

You may use ToUpper() to format the initials, but it is not required. The task is considered correct regardless of letter casing.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 4
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

bookChallenge: Extract Initials

Pyyhkäise näyttääksesi valikon

Tehtävä

Swipe to start coding

You are given a full name as a single string. The name may contain one or more spaces, and you must:

  1. Extract the first name (everything before the first space).
  2. Extract the last name (everything after the last space).
  3. Generate the initials in the format F.L..

If the input does not contain any spaces, treat the entire string as a first name and display:

  • First name
  • "Last name not found"
  • Initials using only the first letter (e.g. J.)

You may use ToUpper() to format the initials, but it is not required. The task is considered correct regardless of letter casing.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 4
single

single

some-alt