LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Daresh

Improved String Subset

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined. 

I made an improved version of String Subset:

 

If offset is non-negative, the returned string will start at the offset# position in string, counting from zero.

If offset is negative, the returned string will start at the offset# character from the end of string.

 

If length is given and is positive, the string returned will contain at most length characters beginning from start (depending on the length of string).

If length is given and is negative, then that many characters will be omitted from the end of string (after the start position has been calculated when an offset is negative).

 

It would be nice if it could work like this by default (no additional inputs needed) 

3 Comments
Mr.Mike
NI Employee (retired)

I like the general idea, but we can't call it Sting Subset and it can't replace the existing one.  Replacing the existing one would cause the behavior to change in people's applications if they happened to (incorrectly) pass negative values already.

 

Additionally, this seems very similar to Slice String in Open G.  You should check that out.  I'd be very hestitant to introduce this in LabVIEW if it already exists in Open G unless a large number of people want it in LabVIEW.

-- Mike
Daresh
Member

Thanks! Slice String does the job! 🙂

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.