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!

Help with expressions 2

Status
Not open for further replies.

dzupfrg

Industrial
Nov 22, 2011
87
Hello, i have expressions (string) with value "XX-EXX" or "XXX-EXX" or "XXEXX".
How to extract text "EXX" from differently expressions values?
Thanks.

NX 9.0.3.3
 
Replies continue below

Recommended for you

So you only want the "E" and everything following it? Does an "E" only appear once in the string?

If the answer to both questions is "yes", then one solution would be to use the "splitstring" expression function.
Code:
[string expression] test1 = "XX-EXX"
[list expression] splittest = splitstring(test1, "E")
[string expression] result = "E" + last(splittest)

If the answer to one of the questions was "no", a solution may be possible with a journal (a journal language would give you more string processing power and logic control).

www.nxjournaling.com
 
Yes, E and everything following. E is once in the string.
Thank You, it works perfectly.

NX 9.0.3.3
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor