Skip to content

Instantly share code, notes, and snippets.

@davidgrenier
Last active December 17, 2015 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidgrenier/5535481 to your computer and use it in GitHub Desktop.
Save davidgrenier/5535481 to your computer and use it in GitHub Desktop.
let datum = "toalla"
let width = 99
System.String(datum |> Seq.truncate width |> Seq.toArray)
|> sprintf "%-*s" width
@davidgrenier
Copy link
Author

let WriteField datum width =
    System.String(datum |> Seq.truncate width |> Seq.toArray)
    |> sprintf "%-*s" width
    |> stream.Write

@davidgrenier
Copy link
Author

let writeField width =
    Seq.truncate width >> Seq.toArray
    >> fun xs -> System.String xs
    >> sprintf "%-*s" width >> stream.Write

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment