Sha256: 4e4452730ab8cdafc229fefd73f10927012977a16ac12a68de350f1c53459be7
Contents?: true
Size: 936 Bytes
Versions: 23
Compression:
Stored size: 936 Bytes
Contents
using System; using rho.common; namespace rho.common { public class Tokenizer { String m_str; String m_delims; int m_length; int m_position; public Tokenizer(String str,String delims) { m_delims = delims; m_str = str; m_length = str.length(); m_position = 0; } public String nextToken() { //eatDelimeters(); int start = m_position; while (m_position<m_length && m_delims.indexOf(m_str.charAt(m_position))==-1) { m_position++; } String strToken = m_str.substring(start,m_position); eatDelimeters(); return strToken; } public void eatDelimeters() { if ( m_position == m_length ) m_position++; else if (m_position<m_length) { char c = m_str.charAt(m_position); if (m_delims.indexOf(c)>=0) { m_position++; } else { return; } } } public boolean hasMoreTokens() { //eatDelimeters(); return (m_position <= m_length); } } }
Version data entries
23 entries across 23 versions & 1 rubygems