How can we remove certain folder name from the path and return new path?
I have a path:
"C:\\Users\\dev\\Test\\TestResults\\Config\\Report.xml"
I need to check if this path has folder "TestResults", if it has then I
need to remove this and return new path as
"C:\\Users\\dev\\Test\\Config\\Report.xml"
I know I can achieve this using trim and split. But just to make sure I
pick up a right choice. What is the best way of achieving this?
Any help really appriciated.
No comments:
Post a Comment