afx Posted February 3, 2018 Share Posted February 3, 2018 Is theres quick way to delete the numbers in a string of crowd assets. string name = "nameOfCharacter56" - what I have string name = "nameOfCharacter" - what I need Quote Link to comment Share on other sites More sharing options...
f1480187 Posted February 3, 2018 Share Posted February 3, 2018 @name = re_replace('nameOfCharacter.*', 'nameOfCharacter', @name); Also: Attribute String Edit. attribstringedit.hipnc Quote Link to comment Share on other sites More sharing options...
afx Posted February 4, 2018 Author Share Posted February 4, 2018 I have multiple characters names. So I needed to find a way to separate the iterations from the character. Something like this worked a bit better. Any Suggestions to what could of been more efficient? i@iteration = opdigits(@name); s@convertToString = itoa(@iteration); string parts[] = split(@name, @convertToString); s@name = parts[0]; attribstringedit_v2.hipnc 1 Quote Link to comment Share on other sites More sharing options...
f1480187 Posted February 4, 2018 Share Posted February 4, 2018 @name = re_replace(r'(.+?)\d+', r'\1', @name); https://regexr.com/3k7l4 2 Quote Link to comment Share on other sites More sharing options...
afx Posted February 4, 2018 Author Share Posted February 4, 2018 Thats awesome, thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.