Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

syntax check

Former Member
0 Kudos

Hi all,

How to check the last word of the sentence to have a '.'

example

hello world -


> hello world.

anycode

thks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

data: w_str type string value 'hello world',

w_len type i.

w_len = strlen( w_str ).

w_len = w_len - 1.

if w_str+w_len(1) eq '.'.

write: / 'String ends with a period'.

else.

write: / 'String doesn't end with a period'.

endif.

Arya

1 REPLY 1

Former Member
0 Kudos

data: w_str type string value 'hello world',

w_len type i.

w_len = strlen( w_str ).

w_len = w_len - 1.

if w_str+w_len(1) eq '.'.

write: / 'String ends with a period'.

else.

write: / 'String doesn't end with a period'.

endif.

Arya