Write a C# Sharp program to create a new string using the two middle characters of a given string of even length (at least 2)
- برمجة سي شارب
- برمجة
- 2021-05-17
- MarwaMohammed
الأجوبة
using System;
namespace exercises
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(test("Hell"));
Console.WriteLine(test("JS"));
Console.ReadLine();
}
public static string test(string s1)
{
return s1.Substring(s1.Length / 2 - 1, 2);
}
}
}
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
