Comparing strings in DataWindow expressions – PB Docs 150

Comparing strings in DataWindow expressions

When you compare strings, the comparison is case sensitive.
Leading blanks are significant, but trailing blanks are not.

Case-sensitivity examples

Assume City1 is “Austin” and City2 is “AUSTIN”.
Then:

To compare strings regardless of case, use the Upper or Lower function.
For example:

For information about these functions, see “Using DataWindow expression functions”.

Blanks examples

Assume City1 is "Austin" and
City2 is " Austin ". Then
the expression:

returns false. PowerBuilder removes
the trailing blank before making the comparison, but it does not
remove the leading blank.

To prevent leading blanks from affecting a comparison, remove
them with one of the trim functions: Trim or LeftTrim.

For example:

To compare strings when trailing blanks are
significant, use an expression such as the following to ensure that
any trailing blanks are included in the comparison:

For information about these functions, see “Using DataWindow expression functions”.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x