Sep 07, 2017 09:54 AM|gani7787|LINK
How to Find Exact Index and caluculate values.
My requirement is below code and logic :
int AddlMark = 150;
string InputStr = "Mark1 + Mark2 - AddlMark + Mark3" - Mark4"; (Formula)
string String1 = "Mark1-Mark2-Mark3-Mark4-Mark5-Mark6"; // and its values is below
string String2 = "86-95-96-98-99-100"; (Mark1-Mark2-Mark3-Mark4-Mark5-Mark6)
Using InputStr (Formula) I want to find the string first match the exact string from string1 and then followed by get values in string2 as order using Inputstr Formula.
i want to use the above calculation using C# with LINQ.
So the Final Output would be as below.
double Result = 0;
Result = 86 + 95 - 150 + 96 - 98; (As per Formula, we need to find and calculate the results)
Result = 525 (Final)..
How to write C# code using LINQ.?
I am geting confused whether we need to go for LINQ or C#.
Can anybody give sample idea to start the above logic using code..?