In server side want do a nested operation with a string. .It will be in dynamic format. I’m trying with razor engine for this. Any ideas..
Eg: "Mystring.ToUpper().FirstPart(3).Replace("M","Ok")"
This string mentioned with the functions name.
Var input = "Mystring.ToUpper().FirstPart(3).Replace("M","Ok");
FirstPart(int val){
.
.
return result;
}
output : OkYS
"Mystring.ToUpper().FirstPart(3).Replace("M","Ok")
Mystring.ToUpper() = MYSTRING,
MYSTRING.FirstPart(3) = MYS,
MYS.Replace("M","Ok")= OkYS
Note: Input will be dynamic.
"Mystring.ToUpper().FirstPart(3).Replace("M","Ok")"
(or)
"Mystring.ToUpper().Replace("M","Ok")"
(or)
"Mystring.ToLower().FirstPart(3)..
or any..
2
Answers
For this case i used dotLiquid
Ex:
My input is "Hello {{ username | upcase | trimval"}}"
trimval is a function which i called from outside.
When render this i'll get the answer .If my input (user = "stackF").Assume Trimval return first 5 chars.
Output = STACK