Gibt das erste Wort aus einem String zurück.
// using System.Text.RegularExpressions;
/// <summary>
/// Gets the first word of the given string.
/// </summary>
/// <param name="token">The token.</param>
/// <returns>the first word of the given string</returns>
private static string GetFirstWordOfString(string token)
{
return Regex.Split(token.TrimStart(), @"[\s]")[0];
}
1 Kommentare zum Snippet