I am new in C# please help to write in efficient C# way.
The case(always first character is ‘-‘ and the last is ‘>’):
Example 1:
input: bdfdfd-wr>
output: wr
Example 2:
input: -dsdsds-sdsds-grtt>
output: grtt
Example 3:
input: -dsdsds-sdsds-grtt>><>>dfdfdfd
output: grtt
Example 4:
input: -dsdsds-sdsds-grtt>><->>df-d=fdfd
output: grtt
EDIT:
Using linq seems to be also a good option: