Noogλe

search input

Function of the day

  • Depending on the boolean `cond', return either the given string or the empty string. Useful to concatenate against a bigger string.

    Inputs

    cond
    Condition
    string
    String to return if condition is true

    Type

    optionalString :: bool -> string -> string
    

    Examples

    lib.strings.optionalString usage example

    optionalString true "some-string"
    => "some-string"
    optionalString false "some-string"
    => ""