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

bookChallenge: Count Keyword Occurrences

Tâche

Swipe to start coding

You are given a text and a search keyword. Your program must:

  1. Count how many times the keyword appears in the text (non-overlapping matches).

  2. Find the index of the first occurrence.

  3. Find the index of the last occurrence.

  4. Print results in a clear, consistent format.

The search must be case-insensitive.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 7
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Suggested prompts:

Can you explain this in simpler terms?

What are the next steps I should take?

Can you provide an example?

close

bookChallenge: Count Keyword Occurrences

Glissez pour afficher le menu

Tâche

Swipe to start coding

You are given a text and a search keyword. Your program must:

  1. Count how many times the keyword appears in the text (non-overlapping matches).

  2. Find the index of the first occurrence.

  3. Find the index of the last occurrence.

  4. Print results in a clear, consistent format.

The search must be case-insensitive.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 7
single

single

some-alt