A custom C++ utility library that provides Date Manipulation and String Processing functionalities implemented from scratch using Object-Oriented Programming principles.
The project contains two main libraries:
- clsString → A utility class for string processing and text manipulation.
- clsDate → A utility class for date calculations, comparisons, calendars, and date arithmetic.
- Count words in a string.
- Convert:
- First letter of each word to uppercase/lowercase.
- Entire string to uppercase/lowercase.
- Invert letter cases.
- Count:
- Capital letters.
- Small letters.
- Specific characters.
- Vowels.
- Split strings using custom delimiters.
- Join strings.
- Trim spaces:
- Left trim.
- Right trim.
- Full trim.
- Reverse words in a sentence.
- Replace words.
- Remove punctuation characters.
-
Construct dates using:
- Current system date.
- String format (
dd/mm/yyyy). - Day, Month, Year.
- Day order inside a year.
-
Leap year detection.
-
Get:
- Number of days in a month.
- Number of days, hours, minutes, and seconds in a month or year.
-
Convert dates to string format.
-
Calculate:
- Day order in a year.
- Difference between two dates.
- Age in days.
-
Compare dates:
- Equal.
- Before.
- After.
-
Date arithmetic:
- Add/Subtract:
- Days
- Weeks
- Months
- Years
- Decades
- Centuries
- Millenniums
- Add/Subtract:
-
Calendar utilities:
- Print monthly calendar.
- Print yearly calendar.
-
Vacation calculations:
- Business days count.
- Vacation duration.
- Return date after vacation.
-
Validate dates.
├── clsString.h
├── clsDate.h
├── String.cpp // Examples of using clsString
└── Date.cpp // Examples of using clsDate
#include "clsString.h"
int main() {
clsString S("hello world");
S.UpperFirstLetterOfEachWord();
cout << S.getValue();
// Output:
// Hello World
return 0;
}cout << clsString::CountWords("I Love C++");
// Output:
// 3#include "clsDate.h"
int main() {
clsDate Date1(10, 5, 2026);
Date1.IncreaseDateByXDays(20);
cout << Date1.DateToString();
return 0;
}clsDate Date1("1/1/2026");
clsDate Date2("10/1/2026");
cout << clsDate::CalculateDifferenceBetweenTwoDatesInDays(Date1, Date2);
// Output:
// 9- Classes and Objects
- Encapsulation
- Constructors Overloading
- Static Methods
- Method Overloading
- Enumerations (
enum) - Utility Library Design
- Date Algorithms
- String Processing Algorithms
The goal of this project is to build custom utility libraries similar to the built-in libraries available in modern programming languages, while practicing Object-Oriented Programming (OOP) and implementing the algorithms manually without relying on external libraries.
Through this project, I practiced:
-
Designing reusable utility libraries.
-
Implementing date algorithms from scratch.
-
Building custom string manipulation functions.
-
Using static and member functions effectively.
-
Applying OOP concepts in real-world style libraries.
-
Working with vectors, strings, and time-related functions in C++.
-
Add operator overloading for date comparison (
==,<,>). -
Support multiple date formats.
-
Add exception handling for invalid dates.
-
Extend string utilities with regex support.