If you got a clean list the upper answers will work just fine. In addition I'd suggest to use a Regex to make it possible to use more complex patterns.
Example
// some crappy input string with upper and lower case and spaces only sometimes before the game name.
string inputString = "Name: game1, StatusName Name: game2, Bla bla Name: game1, Some more Text StatusName Name:game3"; ;
// Define a pattern (explaination on the bottom of this answer)
Regex gameName = new Regex("Name:[ ]?(?<GameName>[^,]*),", RegexOptions.IgnoreCase);
// Create a "list" which will contain the names in the end
HashSet<string> GameNames = new HashSet<string>();
// Loop through all substrings which match our pattern
foreach (Match m in gameName.Matches(inputString))
{
string name = m.Groups["GameName"].Value;
Console.WriteLine("Found: " + name); // what did we match?
// add game to list if not contained
GameNames.Add(name);
}
// Let's see what we got
Console.WriteLine("All Games: " + string.Join(", ", GameNames));
Output
Found: game1
Found: game2
Found: game1
All Games: game1, game2
Regex-Explaination:
Name:[ ]?(?<GameName>[^,]*),
Name: // Has to start with this string
[ ]? // A space-Character, which can occur 0 or 1 time ("?"). ([x]? would be a x 0 or 1 time)
(....) // is a group which can be accessed later
(?<name>) // is a group named "name" which can be accessed by name later
([^]+) // is a group containing any character except comma. 1 to infinite times ("+")
, // Match has to end with a comma.
Linq-Style
And if you like Linq and understood what you're doing, you can run queries on your matches:
var instantList = new Regex("Name:[ ]?(?<GameName>[^,]*),", RegexOptions.IgnoreCase) // Create Regex
.Matches(inputString) // Get Matches to our input
.Cast<Match>() // Cast to Ienumerable<Match>
.Select(s => s.Groups["GameName"].Value) // Select Gamename from Match
.Distinct(); // remove doublicated