ISplitIterator.opApply

'foreach' iteration over string slices between the current and the next delimiter. n() returns the number of 'foreach' loop cycles so far, remaining() the slice after the next delimiter to the content end. If no delimiter was found, n() is 0 after 'foreach' has finished and remaining() returns the content.

pos references the current content position and may be changed to specify the position where searching should be continued. If changed, pos must be at most content.length.

segment slices content so do not modify it. However, the content of segment may be modified which will result in an in-place modification of the content.

  1. int opApply(int delegate(ref cstring segment) dg_in)
  2. int opApply(int delegate(ref size_t pos, ref cstring segment) dg_in)
    class ISplitIterator
    int
    opApply
    (
    scope int delegate
    (
    ref size_t pos
    ,)
    dg_in
    )

Meta