Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski 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
Joined
Apr 27, 2010
Messages
218
Location
US
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.
 
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

Back
Top