CoreClasses Xojo Plugin

StringTokenizerArray Class (console safe)

StringTokenizerArray is a high speed string parser which parses a string all at once, and marks location of found tokens.

The main difference between Xojo built in NthField, StringTokenizerList and StringTokenizerArray:

NthField:
  • Good for short strings with few fields.
  • Parses the string each time you call it, which means if your string has 1000 fields then the string is parsed 1000 times.
  • Can random access fields.
  • Tokens can be previously counted (costing one additional round of parsing)

    StringTokenizerList (fastest):
  • Good for long strings with many fields.
  • Parses the string once only.
  • Parsing is done in incremental steps, which means that it will not allocate any additional memory, and that if you have a string with 1000 fields and only want to get the first 3 then only the first part of the string is parsed.
  • Can not random access fields.
  • Tokens cannot be previously counted.

    StringTokenizerArray (fast):
  • Good for long strings with many fields.
  • Parses the string once only.
  • Parsing is done all at once when the class is constructed. (some additional memory is allocated to store location marks)
  • Can random access fields.
  • Tokens can be previously counted (costing no additional round of parsing)

    This class supports Xojo’s For each syntax when on Xojo 2019r2 or later.

    Object
       StringTokenizerArray

    class StringTokenizerArray implements

    IStringIterator

    Iterable

    Iterator

    Constructors

    StringTokenizerArrayThe constructor for the StringTokenizerArray class.

    Properties

    TokenCountUse this property to get the count of Tokens.

    Methods

    GetNextUse to get next item from the StringTokenizerArray.
    HasNextUse to get info if there are more items in the StringTokenizerArray.
    MoveFirstUse to reset the iterator in the StringTokenizerArray.
    Operator_SubscriptImplements operator to read from the array with the ( ) indexer operator.
    PeekNextUse this function to peek at next item from the StringTokenizerArray without causing iteration.
    TokenAtUse this method to get a token from the desired position in the StringTokenizerArray class.

    Supported Platforms:

  • macOS Intel 64 bit
  • macOS Apple Silicon
  • Windows 32 bit
  • Windows 64 bit
  • Windows ARM 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM 32 bit
  • Linux ARM 64 bit
  • iOS