This is a migrated thread and some comments may be shown as answers.

.net eval() equivalent

1 Answer 78 Views
Miscellaneous
This is a migrated thread and some comments may be shown as answers.
Lorne Green
Top achievements
Rank 1
Lorne Green asked on 13 Feb 2006, 05:12 AM
Say you have two strings.

String 1: "FormatDateTime((0}, DateFormat.ShortDate)"
String 2: "3/17/2005 1:40:00 AM"

Is it possible to apply the format within string 1 to string 2? For what it's worth, the value will not always contain a date, it should be able to handle anything.

I know that the existing EVAL() function would do what I'm looking for, but I need a .NET 2.0 equivalent. TIA!

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 13 Feb 2006, 09:13 AM
Hi Lorne,

To the best of my knowledge there is no built-in Eval support in C# / VB.NET. There is eval support in JScript.NET and some elaborate hacks would be needed to port that to C# / VB.NET. Here is a online article that describes that in detail:

http://www.odetocode.com/Code/80.aspx

Regards,
Elton
the telerik team
Tags
Miscellaneous
Asked by
Lorne Green
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or