Add Lesson 1 Task 4

This commit is contained in:
Stanislav Mykhailenko 2023-03-06 13:52:12 +02:00
parent cc8603e472
commit d7c3bee155
GPG key ID: 1E95E66A9C9D6A36
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,19 @@
Console.Write("Enter string 1: ");
string? string1 = Console.ReadLine();
Console.Write("Enter string 2: ");
string? string2 = Console.ReadLine();
if (string1 == null || string2 == null)
{
}
else if (string1.Length > string2.Length)
Console.WriteLine(string1 + string2);
else if (string1.Length < string2.Length)
{
string[] split = string2.Split(string1[0]);
foreach (string value in split)
Console.WriteLine(value);
}

View file

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>