Jump to content

deleting a portion of a string not an array


Recommended Posts

Your post is a bit confusing as you're interchanging string and array terms. Cleaning that up and posting a bit of what you've tried would help people give better feedback. It sounds like you're using primitives that would do what you want, so it would be helpful to see how you are using them.

Link to post
Share on other sites

Michael, technically what you write is only true for an input array of exactly 5 elements. If you really always want to remove the last three elements the OP needs to use an Array Length node, subtract the number of elements he wants to remove from this length and wire that to the offset. In that case you can leave the size input unwired because it will default to the rest of the array.

Link to post
Share on other sites
14 hours ago, Rolf Kalbermatter said:

If you really always want to remove the last three elements the OP needs to use an Array Length node, subtract the number of elements he wants to remove from this length and wire that to the offset. In that case you can leave the size input unwired because it will default to the rest of the array.

That's too complicated.  Just wire the 3 to the Length and leave the Index unwired.  Delete From Array will default to deleting from the end.

  • Like 1
Link to post
Share on other sites

Okay for the heck of it here is my interpretation.  I read that as OP trying to remove the last few characters from each string in an array.  (also I read "few" as 3).  Also snippets might not be working so attached is a VI in 2018.

Example_VI.png.48ad7231593e3dd1d5991455f4de8d04.png

Remove Strings Test.vi

  • Thanks 1
Link to post
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.

Guest
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...

Important Information

By using this site, you agree to our Terms of Use.