/ Published in: C#
Expand |
Embed | Plain Text
using System; using System.Text; using System.Text.RegularExpressions; namespace RegularExpressions { public class Program { public static void Main() { //-- Take input value and if it is in lastname, firstname format echoes firstname lastname to the console string userName = Console.ReadLine(); userName = re.Replace(userName, "$2 $1"); Console.WriteLine(userName); //-- Take input value and if it is in mm/dd/yyyy format echoes yyyy/mm/dd to the console string curDate = Console.ReadLine(); curDate = reDate.Replace(curDate, "$3/$1/$2"); Console.WriteLine(curDate); } } }
You need to login to post a comment.
