[ Home Page ] [ Eiffel Archive ] [ Eiffel Classes and Clusters ]

Arc de Triomphe clipart (2486 bytes)

String Tokeniser


Written by Steven White.

stringtokens.zip (3,030 bytes) source code
sjwhite@apexmail.com Mail address of Steven White
http://www.barf.homepad.com/The Home Page of Steven White


Introduction

This class breaks a string into tokens. The tokeniser is fairly efficient and is very easy to use and token delimiters can be changed on the fly while iterating. There are many other features such as forcing the case of the result, last_seperator caught determination and can return quoted strings in there entirety.

Installation

Copy string_tokens.e to wherever you keep all good classes :-)

Usage

An example of usage would be :
	local
		token : STRING
		tokens : STRING_TOKENS
	do
		from
			!!tokens.make
			tokens.set("this is a string")
		until
			tokens.is_empty
		loop	
			token := tokens.next
			print(token)
		end
	end

Known Problems

None.

Steven White


[ Home Page ] [ Eiffel Archive ] [ Tools for Eiffel Developers ]