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: 

Reverse String

Solved!
Go to solution

Is there any other simpler way to reverse string (without using 'Reverse String' function) using labVIEW besides the one that I tried in this VI attached below?

Thanx.

0 Kudos
Message 1 of 8
(6,240 Views)
Not viewing your code...
Method 1(Using Loop)
Use array subset and extract single element at a time in a loop ...
The element should be from last to first..
Then use shift register and concatenate string to concatenate single character into string values...

Method 2(without loop)
Typecast string into an array of integers(ASCII Values)
Reverse the integer array created.
Again Typecast integer array into string...
----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 8
(6,227 Views)

SimplifiedReverse String.png

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 8
(6,205 Views)

The 2nd method you suggested was exactly like what I tried. I'll try the 1st method. Just a question, how to read the element should be from last to first?

0 Kudos
Message 4 of 8
(6,192 Views)
Solution
Accepted by topic author MrsBlackSuit

Use string subset in a Loop with Length of String subset is 1 and decrement the offset from String Max Length to Zero.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 5 of 8
(6,186 Views)

@MrsBlackSuit wrote:

Is there any other simpler way to reverse string (without using 'Reverse String' function) using labVIEW besides the one that I tried in this VI attached below?

Thanx.


Why would you want to do anything other than the most effecient way, except to learn about something else?  (Is this homework, in other words.)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 8
(6,151 Views)

Once you have a Byte Array, reverse that array and turn it back into a String.  Three functions between input and output string -- hard to beat that!

 

Bob Schor

 

Oops -- I didn't see that this answer was already given ...

0 Kudos
Message 7 of 8
(6,120 Views)
Solution
Accepted by topic author MrsBlackSuit

Here's a "Rube Goldberg" soultion... If that's what you are looking for 😛

 

reverse.png

========================
=== Engineer Ambiguously ===
========================
Message 8 of 8
(6,112 Views)