You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
598 B
33 lines
598 B
namespace SharpCifs.Util.Sharpen
|
|
{
|
|
public class StringTokenizer
|
|
{
|
|
private string[] _tokens;
|
|
private int _pos;
|
|
|
|
public StringTokenizer(string text, string delim)
|
|
{
|
|
_tokens = text.Split(delim);
|
|
}
|
|
|
|
public int CountTokens()
|
|
{
|
|
return _tokens.Length;
|
|
}
|
|
|
|
public string NextToken()
|
|
{
|
|
string value = _tokens[_pos];
|
|
|
|
_pos++;
|
|
|
|
return value;
|
|
}
|
|
|
|
public bool HasMoreTokens()
|
|
{
|
|
return _pos < _tokens.Length;
|
|
}
|
|
}
|
|
}
|