Hello CodeGuru community.
Im working on a, well i guess you could call it a kind of macro system.
It works this way:
User a wants to send a message to user b, user a writes "Hello $User how are you my name is $Me".
The message is saved and sent to user b but as its saved its converted to "Hello b how are you my name is a."

This I got working the part where im stuck is at $DateSS5. Which I want to be converted into DateTime.Now.AddSecounds(5); //since 5 was the number. All of this has to be dynamical. My current code is:
public string Encode(string Author, string Recipent, string input)
{
string Identifier = "$";
string PreDefBye = "With kind regards $Me";
string PreDefUser = Recipent;
string PreDefMe = Author;
string TimeFormat = "HH:mm:ss dd-MM-yyyy";
DateTime PreDefNow = DateTime.Now;
input = input.Replace(Identifier + "Bye", PreDefBye).Replace(Identifier + "User", PreDefUser).Replace(Identifier + "Me", PreDefMe);
input = input.Replace(Identifier + "Now", PreDefNow.ToString(TimeFormat));
int StartPos = 0;
char[] Dates = { Convert.ToChar(Identifier + "DateSS"), Convert.ToChar(Identifier + "DateMI"), Convert.ToChar(Identifier + "DateHH"), Convert.ToChar(Identifier + "DateDD"), Convert.ToChar(Identifier + "DateMO"), Convert.ToChar(Identifier + "DateYY") };
do
{
StartPos = input.IndexOfAny(Dates, StartPos);
if (StartPos > -1)
{
string DateIden = input[StartPos + 5].ToString().Remove(6);
int result;
int.TryParse((DateIden.Remove(0, 2).Remove(DateIden.IndexOf("."))),out result);
if (result > 0)
{
DateTime Dt = DateTime.Now;
string DateIdentifier = DateIden.Remove(2);
if (DateIdentifier.ToLower() == "ss")
{
Dt.AddSeconds(result);
}
if (DateIdentifier.ToLower() == "mi")
{
Dt.AddMinutes(result);
}
if (DateIdentifier.ToLower() == "hh")
{
Dt.AddHours(result);
}
if (DateIdentifier.ToLower() == "dd")
{
Dt.AddDays(result);
}
if (DateIdentifier.ToLower() == "mo")
{
Dt.AddMonths(result);
}
if (DateIdentifier.ToLower() == "yy")
{
Dt.AddYears(result);
}
input.Insert(StartPos, Dt.ToString(TimeFormat));
input.Remove(StartPos, (input.IndexOf(".", StartPos, 10)));
}

}
} while (StartPos > -1);
return input;
}

This code does not work since im useing a Char[] which is broken since its has more than 1 identifier, i just cant seem to find another way to tackle this problem. Any surgestions for others ways are warmly welcome!

Thank you for reading $Me