base.StringTokenizer.create()

create() is used to initialize a declared StringTokenizer object. This is a class method that requires two arguments.

Syntax:

base.StringTokenizer.Create(sting, delimiter)

Usage example:

MAIN
	DEFINE i TINYINT
	DEFINE tok BASE.StringTokenizer

	LET tok = BASE.StringTokenizer.CREATE('C:\\My Documents\\My Pictures','\\')
	DISPLAY "BASE.StringTokenizer.CREATE('C:\\\\My Documents\\\\My Pictures','\\\\')"
	LET i = 1
	DISPLAY "BASE.StringTokenizer.countTokens() - " , tok.countTokens()
	WHILE tok.hasMoreTokens()
		DISPLAY i, ". >", tok.nextToken(),"<"
		LET i = i + 1
	END WHILE
END MAIN

When using base.StringTokenizer.Create(sting, delimiter), you must follow these rules:

  1. The empty tokens are not taken into account; leading, trailing and consequent delimiters between tokens do not change the number of tokens.
  2. There are no escape characters for the delimiters.
  3. nextToken() can never return NULL strings.

 

Contact Us

Privacy Policy

Copyright © 2025 Querix, (UK) Ltd.