+ 6

eval() in c#

hello. how i can do something like [ eval(); in js or php ] i will not make a text editor , but i need it in code only ! like : 𝐱𝐧𝐭 đ± = 𝐬𝐞𝐜𝐹𝐧𝐝 ; đŹđ­đ«đąđ§đ  đŸđąđ«đŹđ­ = "đĄđžđ„đ„đš 𝐱'𝐩 𝐹𝐧𝐞"; đŹđ­đ«đąđ§đ  𝐬𝐞𝐜𝐹𝐧𝐝 = "đĄđžđ„đ„đš 𝐱'𝐩 𝐭𝐰𝐹"; đŹđ­đ«đąđ§đ  đ­đĄđąđ«đ = "đĄđžđ„đ„đš 𝐱'𝐩 đ­đĄđ«đžđž"; đŹđ­đ«đąđ§đ  đŸđšđźđ«đ­đĄ = "đĄđžđ„đ„đš 𝐱'𝐩 đŸđšđźđ«"; 𝐟𝐼𝐧𝐜(đČ); { đžđŻđšđ„(" đ± = " + đČ); } func(x); đœđšđ§đŹđšđ„đž.đ°đ«đąđ­đž(x); // đšđźđ­đ©đźđ­ : đĄđžđ„đ„đš 𝐱'𝐩 𝐭𝐰𝐹 ---------------------------- i need code like this because i have more than 50 if else and switch blocks and more. thanks =) i try the idea here : https://code.sololearn.com/WbiEHdk01g4l/?ref=app

31st Jul 2018, 12:29 PM
Yousef Eabitan
Yousef Eabitan - avatar
2 Respostas
+ 2
It can be achieved using System.Data.Compute() method. However I'm not sure if it can do string operations. You can refer the Execute function in the following code to get an idea on how to use it (last method in file). https://code.sololearn.com/cUjWf1uegwh6/?ref=app
31st Jul 2018, 5:31 PM
Rusty.Metal
+ 3
Rusty.Metal Thank You , Yes I Need Something Like This , But I Will Try If This will work with me ❀❀
1st Aug 2018, 1:12 PM
Yousef Eabitan
Yousef Eabitan - avatar