In this code, I want the XP number that will be after the [addXP: to add to the XP pool of the player.
if (completionResponse.Choices[0].Text.Contains("[addXP: "))
{
stats.exp +=
}
MUG806
2
You can use String.Replace to remove the unwanted parts of the string, then you can use int.Parse to convert the remaining number text to an int.