LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Beginner] Parsing a string?

Problem: I have an n-character string that I need to pull a substring
from. The substring will be determined when I find the '*' character.
What is the best method for this. I am having trouble with this simple
task as the string token(?) function seems to behave oddly. Normally this
would be a 2 second task but I am a newbie to LabView.

Greg
0 Kudos
Message 1 of 2
(2,509 Views)
Try the Match Pattern vi in the String pallet. Put a constant "*" into the
"regular expression" node, the n-character string into the "string" node.
The characters before the * are returned out of the "before substring" node.
The characters after the * are returned out of the "after substring" node.

Hope this helps.

Jim


wrote in message
news:MPG.13985fe828dd700b989680@news.compuserve.com...
> Problem: I have an n-character string that I need to pull a substring
> from. The substring will be determined when I find the '*' character.
> What is the best method for this. I am having trouble with this simple
> task as the string token(?) function seems to behave oddly. Normally this
> would be a 2 second task but I am a newbie to LabView.
>
> Gr
eg
0 Kudos
Message 2 of 2
(2,508 Views)