Jump to content
Wouter

String equal length

Recommended Posts

VI Name:

String equal length

Total VIs:

2

Description:

There are 2 VIs for checking the length of 2 or more strings, after fetching the length it compares the length and returns true if the length of the strings are equal.

Note:

Maybe there is need to trim whitespaces before fetching the length but this should be a optional feature in my opinion.

Blockdiagram:

2 string inputs:

gallery_17774_56_4060.png

Array string input:

gallery_17774_56_12230.png

Code:

String Equal Length.zip

What are you thoughts on this VI?

  • Would you like to see such a function in OpenG?
  • Can you optimize the code?
  • In which package should it be included?
  • Should it be rejected?

Share this post


Link to post
Share on other sites

Playing devil's advocate: What are the common scenarios for testing whether the length of two strings are equal?

Share this post


Link to post
Share on other sites

I can't think of a time since school that I've had to do something like that. There's some lookup optimizations for hash tables, but that's it. Usually, if I'm worried about string length its with respect to graphics space or string parsing, not comparison.

Share this post


Link to post
Share on other sites

Currently I use the VI with 2 inputs for a fast function exit when calculating the hamming distance of two strings. The array VI I meanly made because well... I can :lol: I'm sure there are probably more use-cases but I can't think of any of them now.

Share this post


Link to post
Share on other sites

I with AQ I think on this - I'm not sure it's a particularly common problem and the code to do it is both simple and obvious. Sure, one could make OpenG an incredibly rich toolkit but with the danger of it taking longer to search for the right function than it would to write the code inline directly.

  • Like 1

Share this post


Link to post
Share on other sites
OpenG an incredibly rich toolkit but with the danger of it taking longer to search for the right function than it would to write the code inline directly.

This is a very valid concern, and it makes we wonder what if any guideline there should be concerning OpenG functional coverage.

Share this post


Link to post
Share on other sites

True I was wondering about that topic as well... because I have a bunch of VI's for all kind of stuff, for example to calculate the Levenshtein distance or Jaro–Winkler distance but I can imagine that not every will need those VI's or want them on the pallet, but other people, like myself, may want them on the pallet...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.