A custom implementation of a string data structure in C# built from scratch using a character array.
This project recreates many of the core features provided by the .NET String class without relying on the built-in implementation. The goal was to deeply understand how string operations work internally and strengthen problem-solving, data structures, algorithms, and object-oriented programming skills.
StringClass is a custom string implementation that stores data internally using a char[] array and provides many common string manipulation methods.
Instead of depending on the built-in String methods, most operations are implemented manually using loops, arrays, collections, and custom algorithms.
This project was created as a learning exercise to understand how string manipulation works behind the scenes.
- Length Property
- ToString()
- Clone()
- Equals()
- EqualsIgnoreCase()
- CompareTo()
- GetHashCode()
- IndexOf()
- LastIndexOf()
- Contains()
- Searching()
- Substring()
- Insert()
- Remove()
- Replace()
- ReplaceSubstring()
- Split()
- SplitByLength()
- SplitLine()
- GetWords()
- Trim()
- TrimStart()
- TrimEnd()
- Normalize()
- ToTitleCase()
- PadLeft()
- PadRight()
- Reverse()
- RemoveSpacing()
- NumberOfChar()
- CountOccurrences()
- IsNullOrEmpty()
- IsNullOrWhiteSpace()
- Join()
- StartsWith()
- EndsWith()
- Truncate()
- SubstringBefore()
- SubstringAfter()
- '+' Operator
- == Operator
- != Operator
- Implicit conversion from string
- Implicit conversion from char[]
- Access character by index
- Access multiple characters using multiple indexes
- C#
- .NET
- Object-Oriented Programming (OOP)
- Data Structures
- Algorithms
Through building this project, I learned:
- How strings are stored internally.
- Working directly with character arrays.
- Implementing common string algorithms manually.
- Building reusable and maintainable code.
- Operator Overloading.
- Indexers.
- Defensive Programming and Validation.
- Memory management concepts.
- Problem Solving techniques.
- Designing custom data structures.
- Improving code organization and readability.
Some challenges faced during development:
- Implementing string searching algorithms.
- Managing indexes safely.
- Handling edge cases.
- Designing methods similar to the .NET String API.
- Keeping operations efficient while maintaining readability.
Possible future enhancements:
- IEnumerable support.
- Generic interfaces implementation.
- Better hash code generation.
- Additional string comparison options.
- Performance optimizations.
- Unit testing.
Hamza Eldeeb
Passionate about learning Computer Science fundamentals, Data Structures, Algorithms, OOP, and Backend Development using C#.
This project was built for educational purposes to understand how string manipulation works internally and to improve software engineering and problem-solving skills.