char simbol = ','; //Символ
int countNeedWords = 3; // количество слов
string inputWords = project.Variables["inputWords"].Value; //Переменная с входной строкой
List<string> wordsList = inputWords.Split(simbol).ToList();
List<string> needWords = wordsList.GetRange(0, countNeedWords);
string resultString = string.Empty;
foreach (var item in needWords)
{
resultString += item + simbol;
}
return resultString.Substring(0, resultString.Length - 1);