Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Compare string in UDF

Hi!

I want to compare a string with multiple values. Will .matches work in SAP PI? Or do I have to use equals?

if(Type.trim().matches("Z001|Z002|Z003|Z004|Z005|Z006"))

  {

  do something

  }

or .equals

if(Type.trim().equals("Z001") || Type.trim().equals("Z002")) // etc

  {

  do something

  }

Former Member
Not what you were looking for? View more on this topic or Ask a question