LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

remove blanks 1d string

hi, 

 

is there a simple way to remove blank spaces from a 1d string

 

eg:- 

 

help forum is awesome     -to-      helpforumisawesome

 

 

many thanks for your ongoing help.

0 Kudos
Message 1 of 24
(3,883 Views)

found the 'search and replace subset string' VI but using a space as the scan string and an empty sting as the replace, it seems to do nothing to the input. help!

0 Kudos
Message 2 of 24
(3,873 Views)

Hi John,

can you show what you have done? Do you mean a 1D Array of strings?

 

Mike

0 Kudos
Message 3 of 24
(3,870 Views)

rather oddly i can't the computer i use isn't on the web and this computer doesn't have LV on it.

 

I'm using a 1D string, looking through it for spaces and trying to replace any space with nothing

 

turning say:-

 

thank you for your reply

 

into

 

thankyouforyourreply

 

I thought using the above vi might work, but it doesn't seem to want to accept a blank string constant as something to search for, it works for any other letter happily.

0 Kudos
Message 4 of 24
(3,863 Views)

hi, sorry no i just mean a string, not a 1d array of strings.

0 Kudos
Message 5 of 24
(3,848 Views)

The function you mention works just fine. Did you set the Boolean to replace all?

0 Kudos
Message 6 of 24
(3,842 Views)

I did set it to replace all yes.

 

how did you put in the blank and space stings? right click-create constant-then type the contents or is there a cleaver way of doing it?

0 Kudos
Message 7 of 24
(3,836 Views)

Creating a constant works that way for the space. You can use the empty string constant on the string palette. Are you sure you have a space in the string? Right click and select '\' Codes Display. A space will show as \s.

Message 8 of 24
(3,830 Views)

might be the empty sting constant constant I need, i'll give it a go when I get a min.

Thanks for your advise.

 

In 99% sure there is a space in there, typed it in over and over to be sure as when you type one character the constant holder got smaller

0 Kudos
Message 9 of 24
(3,827 Views)

not sure if it matters but i'm on LV8.2

0 Kudos
Message 10 of 24
(3,817 Views)