ecl-logo Documentation

StringPartitionRemainder

StringPartitionRemainder[string,partitionSize]substrings

partitions string into substrings of length partitionSize, allowing the final substring to be shorter than partitionSize.

Details

    Input
    Output
    Attributes
  • Listable
  • Messages
  • InvalidPartitionSizePartition size must be an integer greater than 0.

Examples

Basic Examples  (3)

Partition a string into substrings, with any remaining characters forming the final substring:

If the string is evenly divisible by the partition size, equal length strings are returned:

If the parition size is larger than the length of the string, the whole string is returned:

Attributes  (2)

Listable  (2)

Multiple strings can be provided as inputs to be partitioned:

Equal length lists of strings and partition sizes can be provided as inputs:

Messages  (1)

InvalidPartitionSize  (1)

The partition size must be a positive integer: