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.
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.
- 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()...)
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.
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