×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Help with expressions
2

Help with expressions

Help with expressions

(OP)
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

RE: Help with expressions

2
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

RE: Help with expressions

(OP)
Yes, E and everything following. E is once in the string.
Thank You, it works perfectly.

NX 9.0.3.3

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources