I need ideas with the best performance to remove/filter strings
I have:
string Input = "view('512', 3, 159);";
What’s the best performance way to remove “view(” and “);” and the quotes?
I can do this:
Input = Input.Replace("view(","").Replace("'","").Replace("\"","").Replace(");","");
but it seems rather inelegant.
Input.Split('(')[1].Split(')')[0].Replace("'", "");
it seems rather better
I want no do it by using regular expression; I need make the faster application what I can.
Thanks in advance! 🙂
You could use a simple linq statement:
Output: 512,3,159
If you want the spaces, just add a check in the where clause.