jellyfin/Emby.Common.Implementations/IO/SharpCifs/Util/Sharpen/StringTokenizer.cs

33 lines
598 B
C#
Raw Normal View History

2017-04-02 00:36:06 +00:00
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;
}
}
}