Jump to content

Remove bytes from string


Recommended Posts

I'm a little surprised the native Remove White space doesn't work. I also tried the OpenG remove white space and it didn't remove it. There's alot of over head but I think a simple solution would be to use the String to Byte Array, then use the OpenG Filter Array to remove any zeros, then use the byte array to string.

EDIT: Sorry thought of an easier solution. Use the Search and Replace string, where you search for the 00 and replace with nothing. There is a boolean input to remove all, that needs to be set to true.

Link to comment

The NULL character isn't white space, much less a printable character, which is why neither of those VIs did (or should) remove it.

Search and Replace is a good way to do it, or if you know your data will always have 4 NULL characters prepended, you could use String Subset, which may garner a performance gain.

Link to comment
  • 2 weeks later...

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.