Write a C# Sharp program to check if a string 'yt' appears at index 1 in a given string. If it appears return a string without 'yt' otherwise return the original string
- برمجة سي شارب
- برمجة
- 2021-05-16
- MarwaMohammed
الأجوبة
using System;
namespace exercises
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(test("Python"));
Console.WriteLine(test("ytade"));
Console.WriteLine(test("jsues"));
Console.ReadLine();
}
public static string test(string str)
{
return str.Substring(1, 2).Equals("yt") ? str.Remove(1, 2) : str;
}
}
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
