Write a C# Sharp program to create a new string with the last char added at the front and back of a given string of length 1 or more
- برمجة سي شارب
- برمجة
- 2021-05-16
- MarwaMohammed
الأجوبة
using System;
namespace exercises
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(test("Red"));
Console.WriteLine(test("Green"));
Console.WriteLine(test("1"));
Console.ReadLine();
}
public static string test(string str)
{
var s = str.Substring(str.Length-1);
return s + str + s;
}
}
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
