Have a string like A=B&C=D&E=F, how to remove C=D part and get the string like A=B&E=F?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Output: A=B&E=F
You can either split() and manually join (depending how the data looks like) or simly use string.Replace(,string.empty)
I think you need to give a clearer example to make sure it's something for the situation, but something like this should do that:
Something like that should work, and should be pretty dynamic
Either just replace it away:
or use one of the solutions form your previous question, remove it from the data structure and join it back together.
Using my code:
Split it on the
&
separator, exclude theC=D
part by some mechanism, then join the remaining two? TheString
class provides the methods you'd need for that, including splitting, joining and substring matching.