LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with removing trailing zeros

Solved!
Go to solution

Hello.

 

I need help with replacing zeros in the string.

I have a string that is the output of the network packet. There are some trailing zeros in the packet. 

I cannot see them in normal view, but the size of the string tells me that it is bigger then it looks.

When I switch to hex view, you can see zeros.

I tried to use search/replace function and use to find 0 and replace with empty string constant. But, fro some reason it was not removing zeros.

 

I need to stop string after *69.

 

 original string.pnghex string.png

 

 

0 Kudos
Message 1 of 7
(4,113 Views)

Hello.

 

I need help with replacing zeros in the string.

I have a string that is the output of the network packet. There are some trailing zeros in the packet. 

I cannot see them in normal view, but the size of the string tells me that it is bigger then it looks.

When I switch to hex view, you can see zeros.

I tried to use search/replace function and use to find 0 and replace with empty string constant. But, fro some reason it was not removing zeros.

 

I need to stop string after *69.

 

 original string.png

 

hex string.png

 

 

0 Kudos
Message 2 of 7
(4,114 Views)
Solution
Accepted by topic author Rus_K

Show your code.  You don't want to search and replace zeroes.  Those 00 in hex view show they are null characters.  (non-printable byte with value of zero).  You need to search and replace on that character.  (replace string should look like 00 when it is set to show hex code.

 

Message 3 of 7
(4,106 Views)
Solution
Accepted by topic author Rus_K

An alternative to the Search And Replace String here would be Match Pattern.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 7
(4,071 Views)

Thank you. THis is what I wanted,

0 Kudos
Message 5 of 7
(4,055 Views)

Thank you 

0 Kudos
Message 6 of 7
(4,054 Views)

LOL never occured to me to check that it was already answered.  I have nothing new to contribute.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 7
(4,046 Views)