LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Processing Strings

Solved!
Go to solution

I have a string (a filename) of length x characters. I wish to delete the last n characters from the string.

x > n.

n is a known constant.

x is unknown.

I have an idea how I would perform this with an array, but I'm not sure how I perform this on a simple string.

 

(I actually have to perform this on multiple strings in a 1D array of strings, but I plan to use a for loop when I know what code I need to use.)

 

Can anyone advise me on where to start manipulating this problem please.

 

example:

132124_536_YYMMDD_HH;MM;SS.doc = string for processing

132124_536 = desired result

_YYMMDD_HH;MM;SS.doc = string of constant length but changing contents

CLD; LabVIEW since 8.0, Currently have LabVIEW 2022 SP1 installed
0 Kudos
Message 1 of 3
(2,753 Views)
Solution
Accepted by James_W

Hi James W,

you can use the "String Subset" function. Connect "length(string) - n" to the length connector.

 

Mike

Message 2 of 3
(2,752 Views)
Ahh. Thanks Mike
CLD; LabVIEW since 8.0, Currently have LabVIEW 2022 SP1 installed
0 Kudos
Message 3 of 3
(2,748 Views)