LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the 3 first letters in a string?

If I recive a string with 10 letters (serial), how can I find the 3 first
letters in the string.
Let's say I recive "SW2POWER". Then I want to find out the 3 first letters:
"SW".

Richard
0 Kudos
Message 1 of 3
(2,995 Views)
RICHARD EVJE PETTERSEN wrote:

> If I recive a string with 10 letters (serial), how can I find the 3 first
> letters in the string.
> Let's say I recive "SW2POWER". Then I want to find out the 3 first letters:
> "SW".
>
> Richard

Use the String Subset function from the Strings pallete.
You feed in the offset (0 for beginning) and the length (number) of
characters to strip out.
Kevin Kent
0 Kudos
Message 2 of 3
(2,995 Views)
Richard,
i suppose you want to seperate alpha-chars from others.
Find attached file that may serve your task.
Maybe you have to modify it.
It's not clear to me what means "find the 3 first letters"
I found basics of this program in a book, that says:
"Jeff Kodowsky - founder of LabVIEW - suggested something
like this at a fair".
Happy WireWorks
Manfred
0 Kudos
Message 3 of 3
(2,995 Views)