Skip to content

goswinr/Str

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Str

Str on nuget.org Build Status Docs Build Status Test Status Check dotnet tools license code size

Str is an F# extension and module library for System.String It compiles to Javascript and Typescript with Fable.

It Includes:

  • A Str module that has all methods from the String type as functions, and more. Adapted and extended from FSharpX

  • A Computational Expressions str that can be used build up strings ( using a StringBuilder internally).

  • Extension members on Str like .Get .First .Last .SecondLast and more. With nicer IndexOutOfRangeExceptions that include the bad index and the actual size.

  • Extensive Tests running on both .NET and JS

Usage

Just open the module

open Str

this module contains:

  • a static class also called Str
  • a Computational Expressions called str
  • this will also auto open the extension members on System.String

then you can do:

let hello = // "Hello, World !!!"
    str {
        "Hello"
        ','
        " World "
        for i in 1..3 do
            "!"
    }

Full API Documentation

goswinr.github.io/Str

Tests

All Tests run in both javascript and dotnet. Successful Fable compilation to typescript is verified too. Go to the tests folder:

cd Tests

For testing with .NET using Expecto:

dotnet run

for JS testing with Fable.Mocha and TS verification:

npm test

License

MIT

Changelog

see CHANGELOG.md