06-12-2019 11:48 AM
06-12-2019 11:56 AM
Browse around in the String Palate for the answer.
06-12-2019 01:28 PM
Hi mshask,
For example, I have 0.14V, and I want 0.14.
Several options:
It's a nice task to learn about all those string handling functions!
06-12-2019 02:59 PM - edited 06-12-2019 02:59 PM
06-13-2019 04:21 AM
@GerdW wrote:
- Get the string length. Get the string subset with length-1…
- Reverse the string. Get the subset from offset=1. Reverse the string again…
- ScanFromString a float number. FormatIntoString that number…
- FractionalStringToNumber, followed by NumberToFractionalString…
5. Match Pattern (use ".$" as pattern, and use the before string).
6. Match Regular Expression (use ".$" as pattern, and use the before string).
7. Match Regular Expression (use "(.*).$" as pattern, extract and use the submatch 1).
8. Search and Replace String (set to Regular Expression, use ".$" as search string).
1. is probably the easiest answer, but you probably want a number. The first part of 3. and 4. make most sense.
If the pattern gets more complex, 3. and 4. become more attractive. If it gets way more complex, 5. .. 8. could be required.
06-13-2019 04:24 AM
BTW:
Not exactly duplicate, but still most likely an unnecessary waste of (our) time resources:
https://forums.ni.com/t5/LabVIEW/Parse-letters-from-numbers/td-p/3936762
06-13-2019 10:35 AM
wiebe@CARYA wrote:
BTW:
Not exactly duplicate, but still most likely an unnecessary waste of (our) time resources:
https://forums.ni.com/t5/LabVIEW/Parse-letters-from-numbers/td-p/3936762
Yes, both ask the wrong question (remove the extra letters instead of getting the numbers! :D) and don't really specify the desired result (still a string but with fewer characters? A numeric datatype?)