SequentialText

SequentialText

SequentialText A utility class that generates a sequence of formatted strings like `"1"`, `"2"`, etc., using a text template such as `"{0}"` or `"Step {0}"`. Supports resetting and iteration with `for...of`. Example: ```js const st = new SequentialText("Item {0}", 1); st.next(); // "Item 1" st.next(); // "Item 2" ```

Constructor

new SequentialText(textFormat, startValue)

Description:
  • Constructs a sequential text generator instance.
Source:
Parameters:
Name Type Description
textFormat string The format string, default is "{0}".
startValue number The starting number, default is 1.

Classes

SequentialText

Methods

close()

Description:
  • Closes the generator and cleans up internal state.
Source:

next() → {string}

Description:
  • Returns the next generated formatted string.
Source:
Returns:
Type
string

reset()

Description:
  • Resets the generator state so iteration starts over from startValue.
Source: