Удалите в строке все буквы "х" за который следует "abc"
По дате
По рейтингу
12345678
using System;
using System.Text.RegularExpressions;
class Demo {
static void Main() {
Console.WriteLine(Regex.Replace(Console.ReadLine(), "x(?=abc)", ""));
}
} 1234567
using System;
class Demo {
static void Main() {
Console.WriteLine(Console.ReadLine().Replace("xabc", "abc"));
}
} s = s.Replace("xabc", "abc");
Что-то сверху слишком сложным путём пошли.
123456789101112
int Remove(this string line)
{
string res = “”;
int i = 0;
while (i < line.Length)
{
if (i >= line.Length - 3 || line[i] + line[i + 1] + line[i + 2] + line[i + 3] != “xabc”)
res += line[i];
i++;
}
return res;
} Видео по теме