LibStr is a comprehensive C library designed to facilitate efficient manipulation of character arrays. It provides a robust set of functions for common string operations, such as concatenation, splitting, searching, and more. Additionally, the library includes utility functions for checking numeric tokens and converting integers to strings. Streamline your string handling tasks and enhance your C programming experience with this versatile and powerful collection of functions.
- String Concatenation: Easily concatenate multiple strings.
- String Splitting: Split strings based on specified delimiters.
- String Searching: Search for substrings within larger strings.
- Numeric Token Checking: Determine if characters are numeric.
- Integer to String Conversion: Convert integer values to string representations.
Ensure you have a C compiler installed on your system, such as gcc or clang.
To make sure you obtain the most updated stable version of shared library(a DLL in Windows or .so in Unix/Linux), you’ll download this software from its official Github repository.
First, confirm the latest version available in
their releases page. At the time of this writing,
the most current stable version is 1.1.0.
-
The following command will download the
1.1.0release and save the shared library file at /usr/local/lib/libstr.so, which will make this library globally accessible to clients:sudo curl -L "https://github.com/adrian-tech-enthusiast/libstr/releases/download/v1.1.0/libstr.so" -o /usr/local/lib/libstr.so -
Next, We need to tell the loader it is available for use, so let us update the cache, invoke the
ldconfigutility, which configures the system's dynamic loader. This configuration ensures that the loader will find the newly published library:sudo ldconfig;That should create a link to our shared library and update the cache so it is available for immediate use. To verify you can run:
ldconfig -p | grep str -
Copy the library header file(
strutils.h) to where it can be included in one of the C compiler's search path. Typical locations are/usr/includeand/usr/local/include;sudo curl -L "https://raw.githubusercontent.com/adrian-tech-enthusiast/libstr/v1.1.0/include/strutils.h" -o /usr/local/include/strutils.h;
This allows the library header file to be included in your C project as follows:
#include <stdio.h> /* standard input/output functions */ #include <strutils.h> /* C String Utils Library functions */
Without this
#include, the compiler would complain about missing declarations for functions provided by the C File Library. -
Finally, in order to compile your code with the library, add the link flag to the library during the compilation of your C project:
gcc -o tester tester.c -lstr
To compile your program, you might use a command like this, depending on your setup:
gcc -o my_program my_program.c -lstrReplace my_program.c with the name of your source file. Make sure that the libfile is correctly linked.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This library is licensed under the GNU General Public License v3.0 License. See the LICENSE file for details.
Mr. Adrián Morelos - adrian.tech.enthusiast@gmail.com