Skip to content

TizioGrigio0/tizios-cstring-lib

Repository files navigation

Tizio's cstring lib

I made this library because I didn't feel comfortable with my knowledge and experience on cstrings. I will update this in the near future.

What it does

The library contains many useful functions to manage simple tasks on cstrings.
For some functions, there will also be a recursive implementation, if for whatever reason you plan on using this library seriously, don't use the recursive implementation.

Some examples of features present in the library

  • Functions for easy management of cstrings (copy, clone etc.)
  • Functions for simple tasks on words inside cstrings (words to uppercase, count alphanumeric words...)
  • Simple inline character functions (IsUppercase(), ToLowercase(), IsDigit()...)

Bug reporting

In case you find any bug or a better way to do something in my library, feel free to open an issue, I will look into it when I have some free time.

Example project

I also linked a small project in the repo that shows of the features present in the library.

If you want to compile the example yourself:

g++ -Wall -Werror -Wextra example.cpp tizios-cstring-lib.cpp -o example

In case you are too lazy to compile it yourself, here is the result with the input This is a test string

String length: 22
Original string: 
This is a test string

Inverted string: 
gnirts tset a si sihT

Inverted string (starting from 3 to the end): 
Thignirts tset a si s

Inverted string (starting from 2 to strLen-5): 
Ths tset a si sitring

Uppercase letters: 1
Lowercase letters: 16
Letters letters: 17
Alphanumeric characters: 17
Digits: 0
Words: 5
Alphanumeric words: 5

CstringWordsToUppercase(): 
This Is A Test String
Updated characters: 4

CstringAllToLowercase(): 
this is a test string
Updated characters: 1

About

Library made for educational purposes to simplify cstring management

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors