Skip to content

C++ Utilities Library – A lightweight header-only library providing handy math and string helper functions. Simplifies everyday coding tasks like GCD/LCM, prime checks, and string transformations.

Notifications You must be signed in to change notification settings

Gulabkt98/cpp-maths-string_utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🛠️ C++ Utility Library (Header-only)

A lightweight, header-only C++ library (mylib.hpp) providing useful math and string utilities for competitive programming, projects, or everyday coding.

GitHub stars License


⚡ Features

Math Utilities

  • gcd(a, b) → Greatest Common Divisor
  • lcm(a, b) → Least Common Multiple
  • isPrime(n) → Check if a number is prime
  • factors(n) → List all factors/divisors of a number
  • nCr(n, r) → Compute combinations (n choose r)

String Utilities

  • toLower(s) → Convert string to lowercase
  • toUpper(s) → Convert string to uppercase
  • split(s, delimiter) → Split string by a character
  • join(vector<string>, delimiter) → Join strings with delimiter
  • trim(s) → Remove leading and trailing whitespace
  • reverseWords(s) → Reverse order of words in a string
  • startsWith(s, prefix) → Check if string starts with a prefix
  • endsWith(s, suffix) → Check if string ends with a suffix

About

C++ Utilities Library – A lightweight header-only library providing handy math and string helper functions. Simplifies everyday coding tasks like GCD/LCM, prime checks, and string transformations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages