Str
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 FSharpXA 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
Tests
All Tests run in both javascript and dotnet. Successful Fable compilation to typescript is verified too. Go to the tests folder:
|
For testing with .NET using Expecto:
|
for JS testing with Fable.Mocha and TS verification:
|
License
Changelog
see CHANGELOG.md