Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

number of elements in a list for an expression

Status
Not open for further replies.

aluminum2

Aerospace
Apr 27, 2010
218
I am using the SplitString function in expression and I would like to know how many elements I have in the resulting list that is created. for example (SplitString( XX-XX, "-" ) would result in {XX,XX} . I would like to know how many times the string was split.
 
Replies continue below

Recommended for you

Hi,
You can use the length() function to get the number of times the string was broken. Length() gives the overall number in the list generated by the substring function.
So for example if you have a string variable test = "engtips"
then you can directly get the total number of letters (including spaces) by using
LENGTH(SUBSTRING(TEST,""))

Hope this is what you were looking for.
Best Regards
Kapil Sharma
 
Yes, thats what I was looking for. thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor