-
Because string.Replace
does not modify the string, it returns a new one
_viewPath = _viewPath.Replace("tbody", "table");
will do the trick.
讨论(0)
-
You should do:
_viewPath = _viewPath.Replace("tbody", "table");
讨论(0)
-
Strings are immutable. That means you don't modify them - .Replace returns a NEW string. Try this:
_viewPath = _viewpath.Replace("tbody", "table");
讨论(0)
-
Replace
is a function actually, and does return the results. You have to do it this way :
var Result = _viewPath.Replace("tbody", "table");
where Results contains the result of the transformation.
讨论(0)
-
You should save the result of Replace: _viewPath = _viewPath.Replace("tbody", "table");
讨论(0)
- 热议问题