Which is the besto option to Split a String[] path

excel

#1

Hello! I’m trying to Split some directions that are in array like: C:\Users\lopezde\Desktop\Attatchments\OPS Sup A3 Bundles Template.xlsx I just want to get the name of the title. which one will be the best method? and how can I do this??


#2

Hi @denisselizeth,

If you’re talking about getting just the filename from the path you can put your path array in a For Each activity and use path.getfilename(array item) like this:

image

Is that what you were looking for?.

Regards
Troy


#4

I just want to see this part as you mention. I can get just with the full path.

Untitled


#5

I didn’t validate your entire workflow but the first thing you need to do is in your For Each activity change the argument type from Object to String since “item” in “source” is a string.

From this
image

To this
image

See if that gets you any further.


#6

Hi @denisselizeth,
if the solution tmays doesn’t work for you, then you can try splitting the path and getting the last array item as
Split(path, “”)(Split(path, “”).Length-1)

But the solution tmays said is the preferred one.