From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lowercase to Uppercase and Uppercase to Lowercase

Hello.

I am new in the LabView, and I have to do a task. When I will get lowercase it has to be display as a upercase and upercase to lowercase. File of vi - below. Any ideas how to fix it ?

0 Kudos
Message 1 of 38
(6,061 Views)

Do you need to change all lowercase to uppercase and upper to lower?

 

AbCd = aBcD

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 38
(6,054 Views)

I'd brute force it.  For all CHARs (get string subset to get each character at a time) then look at it and if it is in range of the upper, return it as lower, and if lower return as upper, if neither just return it, then concatenate, or index and use array to spreadsheet string.

0 Kudos
Message 3 of 38
(6,051 Views)

It's a little "Rube Goldberg" but it works...

 

AbCd.PNG

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 38
(6,043 Views)

Where can I find this element ?1.jpg

0 Kudos
Message 5 of 38
(6,018 Views)

@Matix02 wrote:

I am new in the LabView, and I have to do a task.


The first change would be to change LabView to LabVIEW. 😄

 

For the problem at hand, I would keep it simple (assuming all non-alphabetical characters should remain as is):

 

SwapLetterCase.png

 

(It is a little-known fact that many string functions work perfectly on U8 as we can see here. See if you can find the various other primitives :D)

Message 6 of 38
(6,013 Views)

I would like to do it, but it easy to have an idea, hard to do (just say). In my .vi, I just wanted to make it, but it's not working. Smiley Sad

0 Kudos
Message 7 of 38
(6,009 Views)

That is in the Array palette and called "Build Array"

 

Converting the string to a Byte Array allows you to use the For Loop's auto indexing function to index one character at a time for processing.

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 8 of 38
(6,007 Views)

@Matix02 wrote:

Where can I find this element ?


"built array" of height=1.

 

(Note that you did not copy the correct pattern so your code will not work anyway). 😮

 

Try to create and understand my code instead. Much more efficient! 🙂

0 Kudos
Message 9 of 38
(6,001 Views)

Gee, I had no idea that the To Upper Case & To Lower Case functions worked on byte arrays.

Note that you can pull some of that stuff out of the loop (might make it faster):

cs.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 10 of 38
(5,985 Views)