String manipulations help needed

Hi need help with string manipulation.
I have a string - “C:\Robot\Team1\Telstra\MediaPlan***”
I want to concatenate the string and only want to extract "C:\Robot\Team1\Telstra" How can i acheieve this.

Pls help.
Thanks

1 Like

Hi,

Can you try the following expression?

System.IO.Path.GetDirectoryName("C:\Robot\Team1\Telstra\MediaPlan***")

Regards,

1 Like

Try this split(“C:\Robot\Team1\Telstra\MediaPlan***”,“\MediaPlan”).First
@Rani1978

1 Like

Var=“C:\Robot\Team1\Telstra\MediaPlan***”

var.Substring(0,var.LastIndexOf(""))

Hi @Rani1978

You can check out this artilce for your reference.

cheers :smiley:

Happy learning :smiley:

4 Likes

Thanks a lot

Thanks for providing a quick solution, it really helped me a lot.

Thanks once again.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.