08-06-2012 10:58 AM - edited 08-06-2012 10:59 AM
Long story short, I want to replicate the String Length function but to not include an input string in the character count. For example:
The input (search) string is "the".
My first string to test is "The big red dog."
This would return a string length of 13.
My second string is "Jumps over the lazy fox."
This would return a length of 21.
"Hello World!" would return 12.
"The Lion The Witch And The Wardrobe" would return 26.
Hopefully you can see what I'm trying to achieve. How is this possble?
- James
(I am runnnig Labview 8.5)
Solved! Go to Solution.
08-06-2012 11:04 AM - edited 08-06-2012 11:11 AM
Take the length of both strings and subtract one from the other ....... ???
08-06-2012 11:07 AM
The input (search) string may or may not be present, or it may be present multiple times. I've had a look through the various string pallets (including some addon pallets) but not found anything that appears to work like this.
08-06-2012 11:07 AM - edited 08-06-2012 11:10 AM
Use the Search and Replace String to replace your "exclusion string" with an empty string. Use the String Length on the resulting string. Make sure the Relace All is set to TRUE.
08-06-2012 11:14 AM
Thank you. I figured it must be fairly simple, but I just couldn't see it!
08-06-2012 11:17 AM
It looks like you also need to set ignore case? to True
08-06-2012 11:30 AM
@Rod wrote:
It looks like you also need to set ignore case? to True
Based on the examples given, you are correct. I just left that one up to the OP to decide if that's what they wanted.