Trying to pull out the title of sheets

Need some help, not that familiar with the commands. I need a “cut before” command or something. I need to pull out the titles of these sheet names that I am getting from a workset list in revision clouds category. Any help would be appreciated. Please see image. Thank you.Capture

after String.Split … use GetItemAtIndex with index of 0 & list should be L2

Another method is using list management and a string function. Works to re-attach the 1", 2" etc, and doesn’t mess up when you only have a list 2 levels deep.

1 Like

thanks khuzaimah. One of the issues with the string plit is that my separator is " - " which is also in the title name. which means a GetItemAtIndex would only grab part of the name. See image.

Thanks Jacob. Unfortunately, the sheet numbers are coming back in for me. I seem to have it the same way as you. Not sure whats going on. Many thanks.Capture

A different approach is to find the index of the separator and create substrings from the original string.
Note that node String.IndexOf will return the index of the first instance found.

  • To get the number substring, the start index will always be 0 and length is actually the index of the separator.
  • To get the title substring, the start index will be the index of separator plus 1 (titleStartIndex), and length the total length of the string minus the titleStartIndex.

After that, just a bit of clean up by removing trailing and leading white spaces.

Hope it helps!

Lacing is off on the list.dropitems node. Try changing it to longest and see if that solves the issue.

That did it man! Thank you!