In C#, simply use .Split
string STR = "abc,def,ghi,jkl,mno,pqr";
string[] phrases = STR.Split(',');
string nthPhrase = phrases[n];
Alternatively, you can use RegEx to get the number as below
String s = "abc,def,ghi,jkl,mno,pqr";
int n = 3;
int j=-1;
MatchCollection myMatches = Regex.Matches(s, ",");
if (myMatches.Count >= n-1 )
{
j = myMatches[n - 1].Index;
}
Hope that helps, If it does mark it as answe/upvote.
Milind