HH\Lib\Str\chunk

Meta Engineer?

This is available as Str\chunk in the www repository.

Returns a vec containing the string split into chunks of the given size

namespace HH\Lib\Str;

function chunk(
  string $string,
  int $chunk_size = 1,
): vec<string>;

To split the string on a delimiter, see Str\split().

Guide

Parameters

  • string $string
  • int $chunk_size = 1

Returns

  • vec<string>