Jump to content

Replace Spaces with hyphens Top Network

Recommended Posts

Hey all, 

   I know I'm pretty close, but think I'm missing a step, was wondering if there is an easy way to replace spaces with hypens at the attribute level in tops?  Or assembling a split string with hyphens in between?  

I have the string split into an array (@split) and the split count in an integer attribute(@splitcount).  


Thanks in advance



Link to comment
Share on other sites

I don't think there's a clean way in tops nodes, but its easy enough with a python script top:


# get
attrib = work_item.stringAttribValue('myattrib')

# split
attrib = attrib.split(' ')
# rejoin with underscores
attrib = '_'.join(attrib)

# set
work_item.setStringAttrib('myattrib', attrib)


  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...