Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nikola-Andreev/43659ada273dbe736eb6396c5b279b4f to your computer and use it in GitHub Desktop.
Save Nikola-Andreev/43659ada273dbe736eb6396c5b279b4f to your computer and use it in GitHub Desktop.
07. To Uppercase
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Numerics;
using System.Globalization;
using System.Text.RegularExpressions;
namespace Praktice
{
class Program
{
static void Main(string[] args)
{
string input = Console.ReadLine();
List<string> output = new List<string>();
int a = 0;
int b = 0;
while (a != -1 && b != -1)
{
a = input.IndexOf("<upcase>");
b = input.IndexOf("</upcase>");
if (a != -1)
{
string text = input.Substring(0, a);
output.Add(text);
string text1 = input.Substring(a + 8, b - (a + 8)).ToUpper();
output.Add(text1);
input = input.Substring(b + 9, input.Length - (b + 9));
}
else
{
string text = input.Substring(0, input.Length);
output.Add(text);
}
}
Console.WriteLine(string.Join("", output));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment