0

I have different formats of a date (i.e.: Birthday):

Like this:

string Birthday = "Next Birthday Jul 30 in 2014";
string Birthday = "Birt 30 6 2014";

So I will create a simple function to get the vars contains this string. I created different lines: First I count length of "Next Birthday ", to get Month, after this I added Month to length to get day... .

Maybe there is a template solution, because I have so many schemas.

Possible Result:

enter code here
string month = "Jul"; // Result after "Next Birthday "
string day = "30"; // Result after "Next Birthday " + month
string year = "2014"; // Result after "Next Birthday " + month +" " + day "in "
4
  • 1
    use DateTime instead of strings to manipulate dates? Commented Oct 28, 2013 at 19:15
  • 1
    do you have control of the formatting? If not you're just going to have to hunt for tokens that look like days/months/years Commented Oct 28, 2013 at 19:16
  • Hi, no there is no chance. So first I will read "day" "month" "year". The result will be checked by an additional function to get formated to DateTime. Commented Oct 28, 2013 at 19:19
  • I solved: stackoverflow.com/questions/9436381/… Commented Oct 28, 2013 at 19:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.