MimeKit.Header.TokenizeText C# (CSharp) Method

TokenizeText() static private method

static private TokenizeText ( string text ) : IEnumerable
text string
return IEnumerable
		static IEnumerable<string> TokenizeText (string text)
		{
			int index = 0;

			while (index < text.Length) {
				int startIndex = index;

				while (index < text.Length && !IsWhiteSpace (text[index]))
					index++;

				yield return text.Substring (startIndex, index - startIndex);

				if (index == text.Length)
					break;

				startIndex = index;

				while (index < text.Length && IsWhiteSpace (text[index]))
					index++;

				yield return text.Substring (startIndex, index - startIndex);
			}

			yield break;
		}