私はそのようなコードを持っています:文字列テキストには{AVATAR}が含まれています
if (text.Contains("{AVATAR}"))
text = Regex.Replace(text, "{AVATAR}", m => rand_avatars());
public string rand_avatars()
{
string[] text = avatars.ToArray();
Random rand = new Random(DateTime.Now.Millisecond);
return text[rand.Next(text.Length)];
}
しかし、replace in out の後、アバターから 2 つの同じ文字列を受け取ります。なんで?