Advertisement
coasterka

UppercaseLetters

Mar 11th, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1. using System;
  2.  
  3. namespace UppercaseLetters
  4. {
  5.     class UppercaseLetters
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("Enter some text here: ");
  10.             string text = Console.ReadLine();
  11.             string toUpperCase = "";
  12.             int index1 = 0;
  13.             int index2 = 0;
  14.             index1 = text.IndexOf("<up>");
  15.             index2 = text.IndexOf("</up>");
  16.             toUpperCase = text.Substring(index1 + 4, index2 - (index1 + 4));
  17.             text = text.Replace("<up>" + toUpperCase + "</up", toUpperCase.ToUpper());
  18.             Console.WriteLine("The new text is: ");
  19.             Console.WriteLine();
  20.             Console.WriteLine(text);
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement