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