clsString is a comprehensive C++ class designed to simplify string manipulation. It provides a robust set of functions for common text-processing tasks, serving as an excellent demonstration of Object-Oriented Programming (OOP) and manual logic implementation.
The library offers a wide range of functionalities organized for ease of use:
- String Analysis: Get length, count words/characters, and perform vowel analysis.
- String Formatting: Change case (Upper/Lower), capitalize words, or invert cases.
- String Cleaning: Advanced trimming (Left, Right, Both) and punctuation removal.
- Text Manipulation: Split, Join, Replace, and Word Reversal logic.
- Static Methods: For direct, stateless one-off operations.
- Instance Objects: To store a string internally and apply multiple sequential transformations.
| Category | Key Methods |
|---|---|
| Parsing | Split, Join, CountWords, ReversString |
| Formatting | UpperAllLattersOfString, LowerAllLattersOfString, InvertAllLettersCaseOfString, UpperFirstLatterOfEachWord |
| Cleaning | TrimLeftForString, TrimRightForString, TrimForString, RemovePunctuations |
| Analysis | CheckCharIsVowel, CountVowelChar, PrintAllVowelInString, CountLetterOfString, CountSmallCapitalLettersInString |
The main goal of this project is hands-on practice and demonstrating the ability to:
- Write clean and organized C++ code.
- Apply core OOP concepts like Encapsulation and Methods.
- Implement complex string-processing logic manually to sharpen problem-solving skills.
- Gain practical experience with
std::stringandstd::vector.
Note: This project is a practical exercise for educational purposes, not a replacement for standard C++ libraries.
This approach is best when you want to perform multiple transformations on the same string instance.
// Create an object with an initial value
clsString text(" !!hello world ");
// Chain transformations sequentially
text.RemovePunctuations();
text.TrimForString();
text.UpperFirstLatterOfEachWord();
cout << text.Value(); // Output: Hello WorldUse this for quick, one-off operations without creating an object.
// Get the first word of a sentence directly using a static method
string result = clsString::Split("Backend.NET.Developer", ".")[0];
cout << result; // Output: Backend- Educational Focus: Some functions include std::cout outputs for demonstration and debugging.
- Clarity Over Performance: The implementation prioritizes code readability and logical flow over micro-optimizations.
This project is provided for educational use and experimentation only.