Skip to content

A C program that splits a user-provided string into two separate substrings based on a specified index N. It manually copies characters into new arrays without using string slicing functions.

License

Notifications You must be signed in to change notification settings

ShotsMan2/String-Splitter-At-Index

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

String Splitter (By Index)

This project implements a string manipulation algorithm in C that divides a text into two parts at a specific cutoff point ($N$).

⚙️ Logic

  1. Input: Reads a source string and a split index $N$.
  2. Part 1 ($0 \to N$): Copies characters from the start up to index $N$ into str1.
  3. Part 2 ($N \to End$): Copies the remaining characters into str2.
  4. Null Termination: Manually adds \0 to the end of both new strings to ensure they are valid C-strings.

🚀 Example Output

Based on Question 6 from the problem set:

Metni giriniz: kolaygelsin
Bolunecek indeksi (n) giriniz: 5

--- Sonuclar ---
Orijinal Metin: kolaygelsin
Str1 (Ilk 5):   kolay
Str2 (Kalan):   gelsin

About

A C program that splits a user-provided string into two separate substrings based on a specified index N. It manually copies characters into new arrays without using string slicing functions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages