The Daily CLAD

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

Re: CLAD2017 - Answer the requirement - Remove those upper case characters

SercoSteveB
Active Participant

You are tasked to write a VI that accepts an input string (String In) and outputs a string (String Out) that contains the contents of the input string but with all of the upper case characters (A to Z inclusive) removed.  Which of the following VIs satisfies those requirements?

 

NOTE:  More than one answer may apply.

 

Have a go at coding the VI yourself or expand the Spoiler tag to display the possible answers.

 

Spoiler
a)
AnswerTheRequirement1.png

b)
AnswerTheRequirement2.png

c)
AnswerTheRequirement3.png

d)
AnswerTheRequirement4.png
NOTE: All other cases for the Case Structure in answer d) are shown below.
AnswerTheRequirement4 Default Case.png

 

Comments
kiranteja93
Member

  B

Vinay_Kumar_M_S
Member

A and C

This is what I didDaily_CLAD_solution.png

 

 

 

sankar06
Member

Ans : B, C, D

Happy to Wire
nik35324
Member

C

 

 

Spoiler
Remove those upper case characters.png

 

SravanKumarAtla
Member

Ans.........A,C,D

Sravankumar Atla
CLD || CTD
crossrulz
Knight of NI

B, C

 

A will reverse the string.

D has the wrong case selection value.  It should be "A".."[" ([ being right after Z on the ASCII table, remembering that the case structure is not inclusive of the upper limit on ranges with strings).

C what my first thought.

B is the way you really should do it.


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
Baltur
Member

I agree with crossrulz , B and C work and B is the IMHO best way to do it.

A will remove the upper case characters, but it will reverse the rest of the string because the Concatenate Strings function is wired wrong.

D doesn't work because of the wrong case selector. "A..Z" will look for the exact string 'A..Z', meaning it will never enter that case. And the better "A".."Z"  would still exclude the "Z". You either have to set the range like crossrulz suggests, or you add Z to the range [A..Z[ :  "A".."Z","Z" 

nik35324
Member

@

Spoiler
Selecting the option "Regular expression" for function "Search and Replace String.vi" searches and replaces the pattern (here: the upper case characters). Otherwise only replaces the exact string specified in "search string".

See the difference in the icons:
Search and Replace String Icons.png

 

crossrulz
Knight of NI

nik35324, nice catch.  I did just assume the Regular Expression was marked.

 

Ok, I change my answer to just C.


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
SercoSteveB
Active Participant

Having B as a possible was a little mean...but that's how I roll.😆

qubirt
Member

B - assuming that Regular Expression is marked.

C - assuming that "Include upper limit" and "Include lower limit" are both selected. I may not remember correctly, but I believe that "Include upper limit" is not selected by default.

Baltur
Member

@ nik35324 : Good catch, I overlooked that one, too.

I am changing my answer to just option C.

 

@ qubirt :  The diamond marks on the left tell you if the limit is inculed or not. If they are both full black, like in the option C, the limits are included. If a limit is not iuncluded the respective diamond is empty with a black border.

Matt-A.
Member

C

Priya16
Member

removing upercase fp.jpg

 

removing uppercase bd.jpg

 

In my example, string out is abCe which means uppercase character C is still present in string out. Why such thing is happened even removing the remaining uppercase characters like A,Z,B,D. Here Where does the logic go wrong?

crossrulz
Knight of NI

Pryia16,

Your problem is that you are moving your pointer without taking in account for the fact that you are removing items.  So when you remove a character, you are not checking the next one.  The easiest solution with this setup would be to make it so that you look at the data backwards (element N-i-1)


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
Priya16
Member

@corrsrulz, 

       Thank you so much for made me clear.

SercoSteveB
Active Participant

Answer: C.  Nice one all.

ChristineM
Member

The answer choices look like VI snippets, but when I drag them into a block diagram they turn into hyperlinks.  How do I get them to be code?  (I am using IE).

istan0227
Member

C