The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Searching Strings

SercoSteveB
Active Participant

What are the values of Boolean Out 1 and Boolean Out 2 following execution of the VI?

Searching Strings 08_12_2014.png

a) Boolean Out 1 = FALSE, Boolean Out 2 = FALSE

b) Boolean Out 1 = FALSE, Boolean Out 2 = TRUE

c) Boolean Out 1 = TRUE, Boolean Out 2 = FALSE

d) Boolean Out 1 = TRUE, Boolean Out 2 = TRUE

Comments
mini09
Active Participant

Initially I guessed D. But later when I looked into the description I go with B. The \ does the trick here.

Nice one steve:)

StuVIEW
NI Employee (retired)

B - Match pattern searches for a regular expression in the string - and the regular expression for a left bracket is \[

A.Bernau
Member

Haha, similar to gnshmrthy Initially I thought A, then I recognized the different behavior 😉

LordNobady
Member

B Nice trick question. I like those.


Learning LabVIEW since January 2013
crossrulz
Knight of NI

B


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
MrStevenUND
Member

tricky.  B.  Me and regular expressions don't get along very well...

kasliwal
Member

B.

match pattern: requires special expressions for finding certain characters. \[ for finding [. Therefore returns -1 for [

search split string: interprets input expresssion as regular characters. \[ means \[.

For [, it would return the index of character immediately after the first match.

SercoSteveB
Active Participant

Answer: B.  Nice one gnshmrthy, Stuart89, Andreas23, LordNobady, crossrulz, MrStevenUND & kasliwal.

Different behavior across two functionaly similar VIs.  Exposure (and subsequent understanding of the difference) is the way to go on this one.

Sangameshsh
Member

B. thanks for tricky question.