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

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -