Write a C# program to create a new string where the first 4 characters will be in lower case. If the string is less than 4 characters then make the whole string in upper case
- برمجة سي شارب
- برمجة
- 2021-05-15
- MarwaMohammed
الأجوبة
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public class Exercise42
{
public static void Main( )
{
Console.Write("Input a string: ");
string str = Console.ReadLine();
if (str.Length < 4)
Console.WriteLine(str.ToUpper());
else
Console.WriteLine(str.Substring(0, 4).ToLower() + str.Substring(4, str.Length -4));
}
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
