LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

remove spaces from string

Altenbach,

47 minutes?  You must eat lunch at 11:00 Smiley Very Happy  Very nice solution.

 

*****



Message Edited by lmtis on 02-13-2008 12:10 PM
Jim

LV 2020
0 Kudos
Message 11 of 19
(3,035 Views)
THANK YOU!!!!
0 Kudos
Message 12 of 19
(3,014 Views)
The attached is straightforward way to get rid of all spaces in a string.....Don
0 Kudos
Message 13 of 19
(2,922 Views)

Using "delete from array" in a loop could get expensive with large inputs because the array in the shift register requires a new allocation in memory for each space found. I would not recommend that. Try to find an "in-place" solution. 🙂

 

 

Alternatively, just do the following... 😮

 

 

 

 

Message Edited by altenbach on 01-21-2009 03:19 PM
Message 14 of 19
(2,903 Views)

I actually tried this earlier but I tried to use a string constant with a space in it as the string to replace instead of using the space constant.

 

Now I now (or know again) about the space constant.

 

Indeed this is a better solution.

 

Thanks,

 

Don 

0 Kudos
Message 15 of 19
(2,872 Views)

DonRoth wrote:

I actually tried this earlier but I tried to use a string constant with a space in it as the string to replace instead of using the space constant.


That should work equally well, though. 🙂

0 Kudos
Message 16 of 19
(2,867 Views)
Actually you are right, I think I used the string constant without putting a space in it!
Message Edited by DonRoth on 01-22-2009 10:37 AM
0 Kudos
Message 17 of 19
(2,864 Views)

Yes, that's probably one of the more confusing behaviors: An empty string constant gets shorter (horizontally) when you type a "space" in it using a proportional font. 😉

 

I would typically set the display to \-codes to make it more readable.

Message 18 of 19
(2,853 Views)
Had I set to 'codes display', I would have discovered my mistake so that is always a good check when dealing with delimiters and such.
0 Kudos
Message 19 of 19
(2,849 Views)