Example Code

Removing the leading zero from a decimal number in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

1. Overview:

This example shows how to remove the leading zero from a decimal, and display the result as a string


2. Description: 

This VI uses the Match Pattern function in order to remove the leading zero. For this purpose, the regular expression is built on special characters "[0-9]+"

- [] Indicates a range when used between digits
- + Matches the longest number of instances of the expression preceding +

See the detailed information of the function to get more information on the special characters

 

3. Requirements

  • LabVIEW 2012 (or compatible)

4. Steps to Implement or Execute Code

  1. Open "Remove Leading Zero LabVIEW 2012 NI Verified"
  2. Run the VI
  3. The leading zero from the decimal string will be removed

5. Additional Information or References 

VI Snippet 

 

Snippet.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.** 

 

Justin E
National Instruments R&D

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.