This commit is contained in:
2024-03-29 14:35:14 -06:00
parent a9cf38ecf2
commit af60bd1e46

View File

@@ -32,10 +32,9 @@ public record LocalQuizQuestionAnswer
string startingQuestionPattern = @"^(\*?[a-z]?\))|\[\s*\]|\[\*\]|\^ "; string startingQuestionPattern = @"^(\*?[a-z]?\))|\[\s*\]|\[\*\]|\^ ";
int replaceCount = 0; int replaceCount = 0;
var text = Regex.Replace(input, startingQuestionPattern, (m) => var text = Regex
{ .Replace(input, startingQuestionPattern, (m) => replaceCount++ == 0 ? "" : m.Value)
return replaceCount++ == 0 ? "" : m.Value; .Trim();
}).Trim();
return new LocalQuizQuestionAnswer() return new LocalQuizQuestionAnswer()
{ {
Correct = isCorrect, Correct = isCorrect,