Prelude API
    Preparing search index...

    Function joinStrings

    • Creates a function that joins string values from an iterable using the specified separator. Similar to Array.prototype.join but works with any iterable of strings.

      Parameters

      • separator: string

        The string to use as separator between joined values

      Returns (values: Iterable<string>) => string

      A function that takes an iterable of strings and returns them joined with the separator

      // Join with comma
      const commaSeparated = G.joinStrings(',');
      commaSeparated(['a', 'b', 'c']); // 'a,b,c'

      // Join with space
      const spaceSeparated = G.joinStrings(' ');
      spaceSeparated(G.map(x => String(x))(G.range(1, 4))); // '1 2 3'

      // Empty separator
      const concatenated = G.joinStrings('');
      concatenated(['hello', 'world']); // 'helloworld'