To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This program will allow you to capitalise any title string so that it capitalises the first letter of each word while ignoring prepositions as one should when creating titles.
Description
The code works by scanning the string for spaces to determine the index at which the string is the first letter of a word and then re writes it to contain a capital. The code then ignores the prepositions by using an array of predefined prepositions which it scans the string for and rewrites them to contain no capital.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
w
Where's the VI?
Sorry, I had forgotten to attach it. It is now up.
Thanks, I posted an edited version that also deals with articles and conjunctions that the previous VI was missing. Also if the word is All Capitals then it deals with that differently (added an ALL Caps input terminal).
I'm not sure why you have 2 arrays for prepositions. Couldn't you just take the first array item and just convert it to lowercase on the fly?