Skip to content

tyler-cromwell/Strutil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

155 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is Strutil?

Strutil is a simple string library that I've been using to supplement the string functions in the C Standard Library.

Functions

  • contains: Tests if a sequence is contained in a string.
  • ends_with: Tests if a string ends with a given token.
  • index_of: Gets the FIRST index of a character within a string.
  • indices_of: Gets ALL indexes of a character withing a string
  • insert: Inserts a string at the specified index.
  • lcs: Computes the Longest Common Subsequence of a pair of strings.
  • lowercase: Sets all letters to lowercase.
  • remove: Removes characters from a string in the given range.
  • remove_each: Removes all given characters from a string.
  • replace_all: Replaces each occurence of a character with a new character in a string.
  • reverse: Reverses the contents of a string.
  • split: Splits a string at each occurence of a token. Returns an array of Strings.
  • starts_with: Tests if a string starts with a given token.
  • substring: Gets a substring within a given range.
  • trim: Trims the leading and trailing spaces in a string.
  • uppercase: Sets all letters to uppercase.

Usage

To use Strutil...

  1. Insert #include <strutil/strutil.h> into your source file(s).
  2. Compile with the -lstrutil flag.

Dependencies

How to Install

$ make
$ sudo make install

How to Uninstall

$ sudo make uninstall

Tests

  1. Build debug library (make debug) from the project root directory.
  2. Clean all executables in the test directory because the static library is used (make clean).
  3. Build all or which ever test you want (make or make <something>).

Contributing

Submit a pull request! Upon submission I will review any and all changes.

Bugs

All bugs and other issues should be reported on the github issue tracker.

About

A simple string library to alleviate annoying string manipulation problems in C

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors