Skip to content

About StringiFor ​

StringiFor (Strings Fortran Manipulator) is a pure Fortran library that provides one type, string: a string of any length with the methods that standard character variables lack. Its design borrows from the string type of Python: split, join, replace, strip, startswith-like inquiries, and many more, as type-bound procedures.

Modern Fortran improved character handling with deferred-length allocatable characters, but an array of them still has elements of one length, and common operations (upper case, tokens, path pieces, casting to numbers) are left to every program. StringiFor fills that gap with a small, consistent API in standard Fortran 2008; a string works wherever a character does, through the overloaded assignment, //, comparison operators and intrinsics. It depends only on three small libraries by the same author, PENF (numeric kinds), FACE (ANSI colours) and BeFoR64 (base64), which every build system fetches.

This documentation reads in order, and each page links to the next one:

  1. Installation: get StringiFor into your project.
  2. The tutorial: six short chapters that build a complete program, step by step.
  3. The cookbook: short recipes, one for each "how do I ...?".
  4. The reference, from the feature map on: every method, every argument.

The API documents the source itself. Why a string type at all, and how StringiFor compares to the other approaches, is discussed in Comparison.

Every code sample of the tutorial, of the cookbook and of the reference is part of a program that is compiled and run to produce the outputs shown (see docs/examples).

Authors ​

Contributions are welcome — see the Contributing page.

Copyrights ​

StringiFor is distributed under a multi-licensing system:

Use caseLicense
FOSS projectsGPL v3
Closed source / commercialBSD 2-Clause
Closed source / commercialBSD 3-Clause
Closed source / commercialMIT