static void Main(string[] args)
{
string code;
code = Console.ReadLine();
if (FindCode(code, "print('"))
{
}
bool FindCode(string code, string codeToFind)
{
Do:
if (code.Length < codeToFind.Length)
return false;
else
{
for (int i = 0; i < code.Length; i++)
{
for (int j = 0; j < codeToFind.Length; j++)
{
if (code[i] == codeToFind[j])
return true;
else
return false;
goto Do;
}
}
}
return false;
}
void Print(string text)
{
Console.WriteLine(text);
}
void PrintFor(string text, int repeat)
{
for (int i = 0; i < repeat; i++)
{
Console.WriteLine(text);
}
}
Console.ReadKey();
using System;
using System.Text.RegularExpressions;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
string input = "blablabla print('Test 1'); blabla print('Test 2')";
string pattern = @"print\(\'([^\']*)\'\)";
foreach (Match m in Regex.Matches(input, pattern))
{
Console.WriteLine(m.Groups[1].Value);
} // foreach
Console.ReadLine();
} // Main
} // class Program
} // namespace
Test 1
Test 2