Skip to content

A C function that accepts a string and two characters as parameters. It iterates through the string and replaces all occurrences of the specified target character with a new replacement character in-place.

License

Notifications You must be signed in to change notification settings

ShotsMan2/String-Character-Replacer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

String Character Replacer

This project implements a string manipulation function in C that substitutes specific characters with new ones.

⚙️ Logic

  1. Function: void Karakter_Degistir(char str[], char old, char new)
  2. Traversal: Loops through the string index by index.
  3. Condition: If str[i] == old, assign str[i] = new.
  4. Result: The input string is modified in-place.

🚀 Example Output

Based on Question 5: Input String: "MERHABA" Replace: 'A' with 'X'

  • Index 1 ('E'): No change
  • Index 4 ('A'): Change to 'X'
  • Index 6 ('A'): Change to 'X'
--- Karakter Degistirme Programi ---
Orijinal Metin: MERHABA
Degisecek: 'A' -> Yeni: 'X'
Yeni Metin:     MERHXHX

About

A C function that accepts a string and two characters as parameters. It iterates through the string and replaces all occurrences of the specified target character with a new replacement character in-place.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages