1
2
3
4
5
6
7
8
9
10
11
|
// 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];
}
|