Map string to string "pattern" - need fast solution
Posted on 2006-03-26
I have a database that saves dates in the follwing format as plain strings: yyyymmddhhmmssiii (iii is miliseconds).
I want to convert this into a readable date string. I need this as a high performance function as I don't know how often it will be used later, in worst case, someone might use it without caching.
So what I look for is something like this:
Response.Write(DBstringToReadableString("dd.mm.yyyy hh:mm:ss", "20060320175422777")
Then this function should take the second string and map all elements as needed in the first string and return:
As I need this as a very fast code, I assume someone could hanlde this with regEx... but I have no idea how you would do that without a lot IFs... anyone any idea please?