Remove trailing pipes - '|' in c# -
i have string looks this:
"pid||000000|z123345|23345|someone^firstname^^^miss^||150|f|1111||1 dreyfus close^south city^county^^post code^^^||0123 45678910^prn^ph^^^^0123 45678910^^~^^cp^^^^^^~^net^^^^^^^||||1a|||||a||||||||n||||||||||";
i trying remove separating '|' characters after 30th '|' in string output string looks this:
"pid||000000|z123345|23345|someone^firstname^^^miss^||150|f|1111||1 dreyfus close^south city^county^^post code^^^||0123 45678910^prn^ph^^^^0123 45678910^^~^^cp^^^^^^~^net^^^^^^^||||1a|||||a||||||||n";
i trying using little code possible, not having luck. or ideas great.
you can use trimend method
string text = "stuff||||n||||||||||"; string result = text.trimend('|'); //result stuff||||n
Comments
Post a Comment