Skip to content

This library is designed to simplify string manipulation operations in C++, offering a wide range of advanced tools to efficiently and easily perform various string operations. The library includes multiple functions

License

Notifications You must be signed in to change notification settings

aw0lid/StringLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ clsString – Lightweight C++ String Utility Library

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.


πŸ›  What This Library Provides

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.

πŸ”„ Dual-Usage Model

  1. Static Methods: For direct, stateless one-off operations.
  2. Instance Objects: To store a string internally and apply multiple sequential transformations.

πŸ“Š Feature Matrix

Category Key Methods
Parsing Split, Join, CountWords, ReversString
Formatting UpperAllLattersOfString, LowerAllLattersOfString, InvertAllLettersCaseOfString, UpperFirstLatterOfEachWord
Cleaning TrimLeftForString, TrimRightForString, TrimForString, RemovePunctuations
Analysis CheckCharIsVowel, CountVowelChar, PrintAllVowelInString, CountLetterOfString, CountSmallCapitalLettersInString

🎯 Project Purpose

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::string and std::vector.

Note: This project is a practical exercise for educational purposes, not a replacement for standard C++ libraries.


πŸ’» Example Usage

1️⃣ Object-Oriented Approach (Instance)

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 World

2️⃣ Static Utility Approach (Stateless)

Use 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

πŸ“ Important Notes

  • 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.

πŸ“œ License

This project is provided for educational use and experimentation only.

About

This library is designed to simplify string manipulation operations in C++, offering a wide range of advanced tools to efficiently and easily perform various string operations. The library includes multiple functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages