Str is an F# extension and module library for System.String
It compiles to Javascript and Typescript with Fable.
-
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
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
"!"
}
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
see CHANGELOG.md